提交 b5406176 编写于 作者: I Ivaylo Dimitrov 提交者: Tony Lindgren

ir-rx51: add DT support to driver

With the upcoming removal of legacy boot, lets add support to one of the
last N900 drivers remaining without it. As the driver still uses omap
dmtimer, add auxdata as well.
Signed-off-by: NIvaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Acked-by: NRob Herring <robh@kernel.org>
Acked-by: NPali Rohár <pali.rohar@gmail.com>
Signed-off-by: NTony Lindgren <tony@atomide.com>
上级 3fdd1526
Device-Tree bindings for LIRC TX driver for Nokia N900(RX51)
Required properties:
- compatible: should be "nokia,n900-ir".
- pwms: specifies PWM used for IR signal transmission.
Example node:
pwm9: dmtimer-pwm@9 {
compatible = "ti,omap-dmtimer-pwm";
ti,timers = <&timer9>;
ti,clock-source = <0x00>; /* timer_sys_ck */
#pwm-cells = <3>;
};
ir: n900-ir {
compatible = "nokia,n900-ir";
pwms = <&pwm9 0 26316 0>; /* 38000 Hz */
};
...@@ -273,8 +273,6 @@ static struct platform_device omap3_rom_rng_device = { ...@@ -273,8 +273,6 @@ static struct platform_device omap3_rom_rng_device = {
}, },
}; };
static struct platform_device rx51_lirc_device;
static void __init nokia_n900_legacy_init(void) static void __init nokia_n900_legacy_init(void)
{ {
hsmmc2_internal_input_clk(); hsmmc2_internal_input_clk();
...@@ -293,10 +291,7 @@ static void __init nokia_n900_legacy_init(void) ...@@ -293,10 +291,7 @@ static void __init nokia_n900_legacy_init(void)
pr_info("RX-51: Registering OMAP3 HWRNG device\n"); pr_info("RX-51: Registering OMAP3 HWRNG device\n");
platform_device_register(&omap3_rom_rng_device); platform_device_register(&omap3_rom_rng_device);
} }
platform_device_register(&rx51_lirc_device);
} }
static void __init omap3_tao3530_legacy_init(void) static void __init omap3_tao3530_legacy_init(void)
...@@ -531,6 +526,7 @@ static struct of_dev_auxdata omap_auxdata_lookup[] __initdata = { ...@@ -531,6 +526,7 @@ static struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
&omap3_iommu_pdata), &omap3_iommu_pdata),
OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x4809c000, "4809c000.mmc", &mmc_pdata[0]), OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x4809c000, "4809c000.mmc", &mmc_pdata[0]),
OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x480b4000, "480b4000.mmc", &mmc_pdata[1]), OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x480b4000, "480b4000.mmc", &mmc_pdata[1]),
OF_DEV_AUXDATA("nokia,n900-ir", 0, "n900-ir", &rx51_lirc_data),
/* Only on am3517 */ /* Only on am3517 */
OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL), OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL),
OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0", OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0",
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/pwm.h> #include <linux/pwm.h>
#include <linux/of.h>
#include <media/lirc.h> #include <media/lirc.h>
#include <media/lirc_dev.h> #include <media/lirc_dev.h>
...@@ -478,6 +479,14 @@ static int lirc_rx51_remove(struct platform_device *dev) ...@@ -478,6 +479,14 @@ static int lirc_rx51_remove(struct platform_device *dev)
return lirc_unregister_driver(lirc_rx51_driver.minor); return lirc_unregister_driver(lirc_rx51_driver.minor);
} }
static const struct of_device_id lirc_rx51_match[] = {
{
.compatible = "nokia,n900-ir",
},
{},
};
MODULE_DEVICE_TABLE(of, lirc_rx51_match);
struct platform_driver lirc_rx51_platform_driver = { struct platform_driver lirc_rx51_platform_driver = {
.probe = lirc_rx51_probe, .probe = lirc_rx51_probe,
.remove = lirc_rx51_remove, .remove = lirc_rx51_remove,
...@@ -485,7 +494,7 @@ struct platform_driver lirc_rx51_platform_driver = { ...@@ -485,7 +494,7 @@ struct platform_driver lirc_rx51_platform_driver = {
.resume = lirc_rx51_resume, .resume = lirc_rx51_resume,
.driver = { .driver = {
.name = DRIVER_NAME, .name = DRIVER_NAME,
.owner = THIS_MODULE, .of_match_table = of_match_ptr(lirc_rx51_match),
}, },
}; };
module_platform_driver(lirc_rx51_platform_driver); module_platform_driver(lirc_rx51_platform_driver);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册