diff options
author | Tony Lindgren <tony@atomide.com> | 2016-04-28 08:21:03 -0700 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2016-04-28 14:26:32 -0700 |
commit | 8453c5cafd32c4d6bd13ec4a62d4b639f4edb222 (patch) | |
tree | 965affedb15af55e92a5304e0dc8ca5ba5e4902c /arch/arm/mach-omap2/board-rx51-peripherals.c | |
parent | f55532a0c0b8bb6148f4e07853b876ef73bc69ca (diff) |
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/board-rx51-peripherals.c')
-rw-r--r-- | arch/arm/mach-omap2/board-rx51-peripherals.c | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index da174c0d603b..9a7073949d1d 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c @@ -30,6 +30,8 @@ #include <linux/platform_data/spi-omap2-mcspi.h> #include <linux/platform_data/mtd-onenand-omap2.h> +#include <plat/dmtimer.h> + #include <asm/system_info.h> #include "common.h" @@ -47,9 +49,8 @@ #include <video/omap-panel-data.h> -#if defined(CONFIG_IR_RX51) || defined(CONFIG_IR_RX51_MODULE) +#include <linux/platform_data/pwm_omap_dmtimer.h> #include <linux/platform_data/media/ir-rx51.h> -#endif #include "mux.h" #include "omap-pm.h" @@ -1212,10 +1213,40 @@ static void __init rx51_init_tsc2005(void) gpio_to_irq(RX51_TSC2005_IRQ_GPIO); } +#if IS_ENABLED(CONFIG_OMAP_DM_TIMER) +static struct pwm_omap_dmtimer_pdata __maybe_unused 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, + .get_fclk = omap_dm_timer_get_fclk, + .start = omap_dm_timer_start, + .stop = omap_dm_timer_stop, + .set_load = omap_dm_timer_set_load, + .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 + #if defined(CONFIG_IR_RX51) || defined(CONFIG_IR_RX51_MODULE) static struct lirc_rx51_platform_data 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 rx51_lirc_device = { |