2015-05-26 19:18:04

by Jean-Baptiste Theou

[permalink] [raw]
Subject: [PATCH 1/2] rtc-isl1208: Add device tree binding

ISL 1208/1218 require a trival i2c binding

Signed-off-by: Jean-Baptiste Theou <[email protected]>
---
Documentation/devicetree/bindings/i2c/trivial-devices.txt | 2 ++
1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
index ad0c4ac..a6f6257 100644
--- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt
+++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
@@ -61,6 +61,8 @@ fsl,sgtl5000 SGTL5000: Ultra Low-Power Audio Codec
gmt,g751 G751: Digital Temperature Sensor and Thermal Watchdog with Two-Wire Interface
infineon,slb9635tt Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz)
infineon,slb9645tt Infineon SLB9645 I2C TPM (new protocol, max 400khz)
+isil,isl1208 Intersil ISL1208 RTC driver
+isil,isl1218 Intersil ISL1218 RTC driver
isil,isl12057 Intersil ISL12057 I2C RTC Chip
isil,isl29028 Intersil ISL29028 Ambient Light and Proximity Sensor
maxim,ds1050 5 Bit Programmable, Pulse-Width Modulator
--
2.4.0


2015-05-26 19:18:01

by Jean-Baptiste Theou

[permalink] [raw]
Subject: [PATCH 2/2] rtc-isl1208: add device tree support

Add a basic device tree support for isl1208 driver

Signed-off-by: Jean-Baptiste Theou <[email protected]>
---
drivers/rtc/rtc-isl1208.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c
index c3c549d..b47a3f9 100644
--- a/drivers/rtc/rtc-isl1208.c
+++ b/drivers/rtc/rtc-isl1208.c
@@ -692,6 +692,14 @@ isl1208_remove(struct i2c_client *client)
return 0;
}

+#ifdef CONFIG_OF
+static const struct of_device_id isl1208_dt_match[] = {
+ { .compatible = "isil,isl1208" },
+ { .compatible = "isil,isl1218" },
+ { },
+};
+#endif
+
static const struct i2c_device_id isl1208_id[] = {
{ "isl1208", 0 },
{ "isl1218", 0 },
@@ -702,6 +710,7 @@ MODULE_DEVICE_TABLE(i2c, isl1208_id);
static struct i2c_driver isl1208_driver = {
.driver = {
.name = "rtc-isl1208",
+ .of_match_table = of_match_ptr(isl1208_dt_match),
},
.probe = isl1208_probe,
.remove = isl1208_remove,
--
2.4.0

2015-05-26 20:20:37

by Alexandre Belloni

[permalink] [raw]
Subject: Re: [PATCH 2/2] rtc-isl1208: add device tree support

Hi,

On 26/05/2015 at 12:12:30 -0700, Jean-Baptiste Theou wrote :
> Add a basic device tree support for isl1208 driver
>
> Signed-off-by: Jean-Baptiste Theou <[email protected]>
> ---
> drivers/rtc/rtc-isl1208.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c
> index c3c549d..b47a3f9 100644
> --- a/drivers/rtc/rtc-isl1208.c
> +++ b/drivers/rtc/rtc-isl1208.c
> @@ -692,6 +692,14 @@ isl1208_remove(struct i2c_client *client)
> return 0;
> }
>
> +#ifdef CONFIG_OF
> +static const struct of_device_id isl1208_dt_match[] = {
> + { .compatible = "isil,isl1208" },
> + { .compatible = "isil,isl1218" },
> + { },
> +};
> +#endif
> +
> static const struct i2c_device_id isl1208_id[] = {
> { "isl1208", 0 },
> { "isl1218", 0 },
> @@ -702,6 +710,7 @@ MODULE_DEVICE_TABLE(i2c, isl1208_id);
> static struct i2c_driver isl1208_driver = {
> .driver = {
> .name = "rtc-isl1208",
> + .of_match_table = of_match_ptr(isl1208_dt_match),

This patch is unnecessary as the i2c subsystem will already match
isil,isl1208 or isil,isl1218 with the i2c_device_id array.

> },
> .probe = isl1208_probe,
> .remove = isl1208_remove,
> --
> 2.4.0
>

--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

2015-05-26 20:49:36

by Jean-Baptiste Theou

[permalink] [raw]
Subject: Re: [PATCH 2/2] rtc-isl1208: add device tree support

Hi,

Indeed. Sorry for the noise.

Best regards

On Tue, 26 May 2015 22:20:32 +0200
Alexandre Belloni <[email protected]> wrote:

> Hi,
>
> On 26/05/2015 at 12:12:30 -0700, Jean-Baptiste Theou wrote :
> > Add a basic device tree support for isl1208 driver
> >
> > Signed-off-by: Jean-Baptiste Theou <[email protected]>
> > ---
> > drivers/rtc/rtc-isl1208.c | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> > diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c
> > index c3c549d..b47a3f9 100644
> > --- a/drivers/rtc/rtc-isl1208.c
> > +++ b/drivers/rtc/rtc-isl1208.c
> > @@ -692,6 +692,14 @@ isl1208_remove(struct i2c_client *client)
> > return 0;
> > }
> >
> > +#ifdef CONFIG_OF
> > +static const struct of_device_id isl1208_dt_match[] = {
> > + { .compatible = "isil,isl1208" },
> > + { .compatible = "isil,isl1218" },
> > + { },
> > +};
> > +#endif
> > +
> > static const struct i2c_device_id isl1208_id[] = {
> > { "isl1208", 0 },
> > { "isl1218", 0 },
> > @@ -702,6 +710,7 @@ MODULE_DEVICE_TABLE(i2c, isl1208_id);
> > static struct i2c_driver isl1208_driver = {
> > .driver = {
> > .name = "rtc-isl1208",
> > + .of_match_table = of_match_ptr(isl1208_dt_match),
>
> This patch is unnecessary as the i2c subsystem will already match
> isil,isl1208 or isil,isl1218 with the i2c_device_id array.
>
> > },
> > .probe = isl1208_probe,
> > .remove = isl1208_remove,
> > --
> > 2.4.0
> >
>
> --
> Alexandre Belloni, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com


--
Jean-Baptiste Theou <[email protected]>