Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1396318
| From | Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 4/7] [media] ir-rx51: add DT support to driver |
| Date | 2016-05-07 17:30 +0200 |
| Message-ID | <rwcl4-3SB-9@gated-at.bofh.it> (permalink) |
| References | <rwcl4-3SB-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
---
.../devicetree/bindings/media/nokia,lirc-rx51 | 19 +++++++++++++++++++
arch/arm/mach-omap2/pdata-quirks.c | 6 +-----
drivers/media/rc/ir-rx51.c | 11 ++++++++++-
3 files changed, 30 insertions(+), 6 deletions(-)
create mode 100644 Documentation/devicetree/bindings/media/nokia,lirc-rx51
diff --git a/Documentation/devicetree/bindings/media/nokia,lirc-rx51 b/Documentation/devicetree/bindings/media/nokia,lirc-rx51
new file mode 100644
index 0000000..5b3081e
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/nokia,lirc-rx51
@@ -0,0 +1,19 @@
+Device-Tree bindings for LIRC TX driver for Nokia N900(RX51)
+
+Required properties:
+ - compatible: should be "nokia,lirc-rx51".
+ - pwms: specifies PWM used for IR signal transmission.
+
+Example node:
+
+ pwm9: dmtimer-pwm@9 {
+ compatible = "ti,omap-dmtimer-pwm";
+ ti,timers = <&timer9>;
+ #pwm-cells = <3>;
+ };
+
+ ir: lirc-rx51 {
+ compatible = "nokia,lirc-rx51";
+
+ pwms = <&pwm9 0 26316 0>; /* 38000 Hz */
+ };
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index af65781..c15ccac 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -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)
{
hsmmc2_internal_input_clk();
@@ -293,10 +291,7 @@ static void __init nokia_n900_legacy_init(void)
pr_info("RX-51: Registering OMAP3 HWRNG device\n");
platform_device_register(&omap3_rom_rng_device);
-
}
-
- platform_device_register(&rx51_lirc_device);
}
static void __init omap3_tao3530_legacy_init(void)
@@ -534,6 +529,7 @@ static struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
&omap3_iommu_pdata),
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("nokia,lirc-rx51", 0, "lirc-rx51", &rx51_lirc_data),
/* Only on am3517 */
OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL),
OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0",
diff --git a/drivers/media/rc/ir-rx51.c b/drivers/media/rc/ir-rx51.c
index 5096ef3..7a329d8 100644
--- a/drivers/media/rc/ir-rx51.c
+++ b/drivers/media/rc/ir-rx51.c
@@ -21,6 +21,7 @@
#include <linux/sched.h>
#include <linux/wait.h>
#include <linux/pwm.h>
+#include <linux/of.h>
#include <media/lirc.h>
#include <media/lirc_dev.h>
@@ -478,6 +479,14 @@ static int lirc_rx51_remove(struct platform_device *dev)
return lirc_unregister_driver(lirc_rx51_driver.minor);
}
+static const struct of_device_id lirc_rx51_match[] = {
+ {
+ .compatible = "nokia,lirc-rx51",
+ },
+ {},
+};
+MODULE_DEVICE_TABLE(of, lirc_rx51_match);
+
struct platform_driver lirc_rx51_platform_driver = {
.probe = lirc_rx51_probe,
.remove = lirc_rx51_remove,
@@ -485,7 +494,7 @@ struct platform_driver lirc_rx51_platform_driver = {
.resume = lirc_rx51_resume,
.driver = {
.name = DRIVER_NAME,
- .owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(lirc_rx51_match),
},
};
module_platform_driver(lirc_rx51_platform_driver);
--
1.9.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/7] ir-rx51 driver fixes Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> - 2016-05-07 17:30 +0200
[PATCH 3/7] [media] ir-rx51: use PWM framework instead of OMAP dmtimer Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> - 2016-05-07 17:30 +0200
[PATCH 4/7] [media] ir-rx51: add DT support to driver Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> - 2016-05-07 17:30 +0200
Re: [PATCH 4/7] [media] ir-rx51: add DT support to driver Rob Herring <robh@kernel.org> - 2016-05-09 22:10 +0200
Re: [PATCH 4/7] [media] ir-rx51: add DT support to driver Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> - 2016-05-09 23:00 +0200
Re: [PATCH 4/7] [media] ir-rx51: add DT support to driver Rob Herring <robh@kernel.org> - 2016-05-09 23:10 +0200
Re: [PATCH 4/7] [media] ir-rx51: add DT support to driver Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> - 2016-05-10 00:10 +0200
Re: [PATCH 4/7] [media] ir-rx51: add DT support to driver Sebastian Reichel <sre@kernel.org> - 2016-05-10 04:20 +0200
Re: [PATCH 4/7] [media] ir-rx51: add DT support to driver Rob Herring <robh@kernel.org> - 2016-05-11 16:20 +0200
[PATCH 6/7] [media] ir-rx51: use hrtimer instead of dmtimer Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> - 2016-05-07 17:30 +0200
[PATCH 5/7] ARM: OMAP: dmtimer: Do not call PM runtime functions when not needed. Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> - 2016-05-07 17:30 +0200
Re: [PATCH 5/7] ARM: OMAP: dmtimer: Do not call PM runtime functions when not needed. Tony Lindgren <tony@atomide.com> - 2016-05-09 21:40 +0200
Re: [PATCH 5/7] ARM: OMAP: dmtimer: Do not call PM runtime functions when not needed. Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> - 2016-05-09 23:00 +0200
[PATCH 2/7] pwm: omap-dmtimer: Allow for setting dmtimer clock source Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> - 2016-05-07 17:30 +0200
Re: [PATCH 2/7] pwm: omap-dmtimer: Allow for setting dmtimer clock source Rob Herring <robh@kernel.org> - 2016-05-09 22:10 +0200
[PATCH 1/7] ir-rx51: Fix build after multiarch changes broke it Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> - 2016-05-07 17:30 +0200
[PATCH 7/7] ARM: dts: n900: enable lirc-rx51 driver Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> - 2016-05-07 17:30 +0200
csiph-web