diff options
author | Tony Lindgren <tony@atomide.com> | 2016-04-28 15:21:03 (GMT) |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2016-04-28 21:26:32 (GMT) |
commit | 8453c5cafd32c4d6bd13ec4a62d4b639f4edb222 (patch) | |
tree | 965affedb15af55e92a5304e0dc8ca5ba5e4902c /arch/arm/mach-omap2/pdata-quirks.c | |
parent | f55532a0c0b8bb6148f4e07853b876ef73bc69ca (diff) | |
download | linux-8453c5cafd32c4d6bd13ec4a62d4b639f4edb222.tar.xz |
ARM: OMAP2+: Add more functions to pwm pdata for ir-rx51
Before we start removing omap3 legacy booting support, let's make n900
DT booting behave the same way for ir-rx51 as the legacy booting does.
For now, we need to pass pdata to the ir-rx51 driver. This means that
the n900 tree can move to using DT based booting without having to carry
all the legacy platform data with it when it gets dropped from the mainline
tree.
Note that the ir-rx51 driver is currently disabled because of the
dependency to !ARCH_MULTIPLATFORM. This will get sorted out later
with the help of drivers/pwm/pwm-omap-dmtimer.c. But first we need
to add chained IRQ support to dmtimer code to avoid introducing new
custom frameworks.
So let's just pass the necessary dmtimer functions to ir-rx51 so we
can get it working in the following patch.
Cc: Neil Armstrong <narmstrong@baylibre.com>
Tested-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/pdata-quirks.c')
-rw-r--r-- | arch/arm/mach-omap2/pdata-quirks.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c index a935d28..f8d389d 100644 --- a/arch/arm/mach-omap2/pdata-quirks.c +++ b/arch/arm/mach-omap2/pdata-quirks.c @@ -24,6 +24,7 @@ #include <linux/platform_data/iommu-omap.h> #include <linux/platform_data/wkup_m3.h> #include <linux/platform_data/pwm_omap_dmtimer.h> +#include <linux/platform_data/media/ir-rx51.h> #include <plat/dmtimer.h> #include "common.h" @@ -31,6 +32,7 @@ #include "dss-common.h" #include "control.h" #include "omap_device.h" +#include "omap-pm.h" #include "omap-secure.h" #include "soc.h" #include "hsmmc.h" @@ -268,6 +270,8 @@ static struct platform_device omap3_rom_rng_device = { }, }; +static struct platform_device rx51_lirc_device; + static void __init nokia_n900_legacy_init(void) { hsmmc2_internal_input_clk(); @@ -286,6 +290,8 @@ static void __init nokia_n900_legacy_init(void) platform_device_register(&omap3_rom_rng_device); } + + platform_device_register(&rx51_lirc_device); } static void __init omap3_tao3530_legacy_init(void) @@ -453,8 +459,14 @@ void omap_auxdata_legacy_init(struct device *dev) /* Dual mode timer PWM callbacks platdata */ #if IS_ENABLED(CONFIG_OMAP_DM_TIMER) -struct pwm_omap_dmtimer_pdata pwm_dmtimer_pdata = { +static struct pwm_omap_dmtimer_pdata pwm_dmtimer_pdata = { .request_by_node = omap_dm_timer_request_by_node, + .request_specific = omap_dm_timer_request_specific, + .request = omap_dm_timer_request, + .set_source = omap_dm_timer_set_source, + .get_irq = omap_dm_timer_get_irq, + .set_int_enable = omap_dm_timer_set_int_enable, + .set_int_disable = omap_dm_timer_set_int_disable, .free = omap_dm_timer_free, .enable = omap_dm_timer_enable, .disable = omap_dm_timer_disable, @@ -465,10 +477,29 @@ struct pwm_omap_dmtimer_pdata pwm_dmtimer_pdata = { .set_match = omap_dm_timer_set_match, .set_pwm = omap_dm_timer_set_pwm, .set_prescaler = omap_dm_timer_set_prescaler, + .read_counter = omap_dm_timer_read_counter, .write_counter = omap_dm_timer_write_counter, + .read_status = omap_dm_timer_read_status, + .write_status = omap_dm_timer_write_status, }; #endif +static struct lirc_rx51_platform_data __maybe_unused rx51_lirc_data = { + .set_max_mpu_wakeup_lat = omap_pm_set_max_mpu_wakeup_lat, + .pwm_timer = 9, /* Use GPT 9 for CIR */ +#if IS_ENABLED(CONFIG_OMAP_DM_TIMER) + .dmtimer = &pwm_dmtimer_pdata, +#endif +}; + +static struct platform_device __maybe_unused rx51_lirc_device = { + .name = "lirc_rx51", + .id = -1, + .dev = { + .platform_data = &rx51_lirc_data, + }, +}; + /* * Few boards still need auxdata populated before we populate * the dev entries in of_platform_populate(). |