All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Implement EPSON RX-8035 support
@ 2021-07-07  7:16 Mathew McBride
  2021-07-07  7:16 ` [PATCH 1/2] rtc: rx8025: implement " Mathew McBride
  2021-07-07  7:16 ` [PATCH 2/2] dt-bindings: rtc: add Epson RX-8025 and RX-8035 Mathew McBride
  0 siblings, 2 replies; 9+ messages in thread
From: Mathew McBride @ 2021-07-07  7:16 UTC (permalink / raw)
  To: linux-rtc, Alessandro Zummo, Alexandre Belloni, Rob Herring, devicetree
  Cc: Mathew McBride

The EPSON RX-8035[SA] is a I2C real time clock module with
built-in oscillator[1]. It is a very close relative of the EPSON
RX-8025 that is supported by the rtc-rx8025 driver.

The main difference is that the RX-8035 has inverted the
'oscillator stop' bit in the control register. The operation
of the devices is otherwise identical for the features currently
supported.

Curiously, the RX-8025 is also supported by the ds1307 driver
as the time register set is compatible. The control registers,
however, are not.

I have decided to implement the RX-8035 in rtc-rx8025 due the simplicity
of that driver.

As best as I can determine, the rtc-rx8025 driver was in the tree
some months[1] before rx8025 support was added to ds1307[2]. 

[1] - https://www5.epsondevice.com/en/products/rtc/rx8035sa.html
[2] - commit 3c2b9075cbdb541dbe486bde45925c9610de6f35
[3] - commit a216685818a54b4f15235068b53908f954850251

Mathew McBride (2):
  rtc: rx8025: implement RX-8035 support
  dt-bindings: rtc: add Epson RX-8025 and RX-8035

 .../devicetree/bindings/rtc/trivial-rtc.yaml  |  3 +
 drivers/rtc/rtc-rx8025.c                      | 59 +++++++++++++++++--
 2 files changed, 56 insertions(+), 6 deletions(-)

-- 
2.30.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/2] rtc: rx8025: implement RX-8035 support
  2021-07-07  7:16 [PATCH 0/2] Implement EPSON RX-8035 support Mathew McBride
@ 2021-07-07  7:16 ` Mathew McBride
  2021-07-07 21:38   ` Nobuhiro Iwamatsu
  2021-07-07  7:16 ` [PATCH 2/2] dt-bindings: rtc: add Epson RX-8025 and RX-8035 Mathew McBride
  1 sibling, 1 reply; 9+ messages in thread
From: Mathew McBride @ 2021-07-07  7:16 UTC (permalink / raw)
  To: linux-rtc, Alessandro Zummo, Alexandre Belloni, Rob Herring, devicetree
  Cc: Mathew McBride

The RX-8035 is a newer RTC from EPSON that is very
similar to the RX-8025.

The key difference is in the oscillation stop (XSTP)
bit which is inverted on the RX-8035.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
---
 drivers/rtc/rtc-rx8025.c | 59 ++++++++++++++++++++++++++++++++++++----
 1 file changed, 53 insertions(+), 6 deletions(-)

diff --git a/drivers/rtc/rtc-rx8025.c b/drivers/rtc/rtc-rx8025.c
index c914091819ba..1a33ec402f4a 100644
--- a/drivers/rtc/rtc-rx8025.c
+++ b/drivers/rtc/rtc-rx8025.c
@@ -60,14 +60,24 @@
 #define RX8025_ADJ_DATA_MAX	62
 #define RX8025_ADJ_DATA_MIN	-62
 
+enum rx_model {
+	model_rx_unknown,
+	model_rx_8025,
+	model_rx_8035,
+	model_last
+};
+
 static const struct i2c_device_id rx8025_id[] = {
-	{ "rx8025", 0 },
+	{ "rx8025", model_rx_8025 },
+	{ "rx8035", model_rx_8035 },
 	{ }
 };
+
 MODULE_DEVICE_TABLE(i2c, rx8025_id);
 
 struct rx8025_data {
 	struct rtc_device *rtc;
+	enum rx_model type;
 	u8 ctrl1;
 };
 
@@ -100,10 +110,26 @@ static s32 rx8025_write_regs(const struct i2c_client *client,
 					      length, values);
 }
 
+static int rx8025_is_osc_stopped(enum rx_model model, int ctrl2)
+{
+	int xstp = ctrl2 & RX8025_BIT_CTRL2_XST;
+	/* XSTP bit has different polarity on RX-8025 vs RX-8035.
+	 * RX-8025: 0 == oscillator stopped
+	 * RX-8035: 1 == oscillator stopped
+	 */
+
+	if (model == model_rx_8025)
+		xstp = !xstp;
+
+	return xstp;
+}
+
 static int rx8025_check_validity(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
+	struct rx8025_data *drvdata = dev_get_drvdata(dev);
 	int ctrl2;
+	int xstp;
 
 	ctrl2 = rx8025_read_reg(client, RX8025_REG_CTRL2);
 	if (ctrl2 < 0)
@@ -117,7 +143,8 @@ static int rx8025_check_validity(struct device *dev)
 		return -EINVAL;
 	}
 
-	if (!(ctrl2 & RX8025_BIT_CTRL2_XST)) {
+	xstp = rx8025_is_osc_stopped(drvdata->type, ctrl2);
+	if (xstp) {
 		dev_warn(dev, "crystal stopped, date is invalid\n");
 		return -EINVAL;
 	}
@@ -125,7 +152,7 @@ static int rx8025_check_validity(struct device *dev)
 	return 0;
 }
 
-static int rx8025_reset_validity(struct i2c_client *client)
+static int rx8025_reset_validity(enum rx_model model, struct i2c_client *client)
 {
 	int ctrl2 = rx8025_read_reg(client, RX8025_REG_CTRL2);
 
@@ -134,8 +161,13 @@ static int rx8025_reset_validity(struct i2c_client *client)
 
 	ctrl2 &= ~(RX8025_BIT_CTRL2_PON | RX8025_BIT_CTRL2_VDET);
 
+	if (model == model_rx_8025)
+		ctrl2 |= RX8025_BIT_CTRL2_XST;
+	else
+		ctrl2 &= ~(RX8025_BIT_CTRL2_XST);
+
 	return rx8025_write_reg(client, RX8025_REG_CTRL2,
-				ctrl2 | RX8025_BIT_CTRL2_XST);
+				ctrl2);
 }
 
 static irqreturn_t rx8025_handle_irq(int irq, void *dev_id)
@@ -149,7 +181,7 @@ static irqreturn_t rx8025_handle_irq(int irq, void *dev_id)
 	if (status < 0)
 		goto out;
 
-	if (!(status & RX8025_BIT_CTRL2_XST))
+	if (rx8025_is_osc_stopped(rx8025->type, status))
 		dev_warn(&client->dev, "Oscillation stop was detected,"
 			 "you may have to readjust the clock\n");
 
@@ -241,7 +273,7 @@ static int rx8025_set_time(struct device *dev, struct rtc_time *dt)
 	if (ret < 0)
 		return ret;
 
-	return rx8025_reset_validity(client);
+	return rx8025_reset_validity(rx8025->type, client);
 }
 
 static int rx8025_init_client(struct i2c_client *client)
@@ -519,6 +551,21 @@ static int rx8025_probe(struct i2c_client *client,
 
 	i2c_set_clientdata(client, rx8025);
 
+	if (id) {
+		rx8025->type = id->driver_data;
+		switch (rx8025->type) {
+		case model_rx_8025:
+			dev_info(&client->dev, "Type RX-8025");
+		break;
+		case model_rx_8035:
+			dev_info(&client->dev, "Type RX-8035");
+			break;
+		default:
+			dev_warn(&client->dev, "Unknown type: %d\n", rx8025->type);
+		break;
+		}
+	}
+
 	err = rx8025_init_client(client);
 	if (err)
 		return err;
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] dt-bindings: rtc: add Epson RX-8025 and RX-8035
  2021-07-07  7:16 [PATCH 0/2] Implement EPSON RX-8035 support Mathew McBride
  2021-07-07  7:16 ` [PATCH 1/2] rtc: rx8025: implement " Mathew McBride
@ 2021-07-07  7:16 ` Mathew McBride
  2021-07-07 21:46   ` Nobuhiro Iwamatsu
  1 sibling, 1 reply; 9+ messages in thread
From: Mathew McBride @ 2021-07-07  7:16 UTC (permalink / raw)
  To: linux-rtc, Alessandro Zummo, Alexandre Belloni, Rob Herring, devicetree
  Cc: Mathew McBride

These are supported by the rtc-rx8025 module. RX-8025
also has support in ds1307 due to compatible time registers.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
---
 Documentation/devicetree/bindings/rtc/trivial-rtc.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml b/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml
index 7548d8714871..13925bb78ec7 100644
--- a/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml
+++ b/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml
@@ -32,6 +32,9 @@ properties:
       - dallas,ds3232
       # I2C-BUS INTERFACE REAL TIME CLOCK MODULE
       - epson,rx8010
+      # I2C-BUS INTERFACE REAL TIME CLOCK MODULE
+      - epson,rx8025
+      - epson,rx8035
       # I2C-BUS INTERFACE REAL TIME CLOCK MODULE with Battery Backed RAM
       - epson,rx8571
       # I2C-BUS INTERFACE REAL TIME CLOCK MODULE
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] rtc: rx8025: implement RX-8035 support
  2021-07-07  7:16 ` [PATCH 1/2] rtc: rx8025: implement " Mathew McBride
@ 2021-07-07 21:38   ` Nobuhiro Iwamatsu
  0 siblings, 0 replies; 9+ messages in thread
From: Nobuhiro Iwamatsu @ 2021-07-07 21:38 UTC (permalink / raw)
  To: Mathew McBride
  Cc: linux-rtc, Alessandro Zummo, Alexandre Belloni, Rob Herring, devicetree

Hi,

2021年7月7日(水) 16:17 Mathew McBride <matt@traverse.com.au>:
>
> The RX-8035 is a newer RTC from EPSON that is very
> similar to the RX-8025.
>
> The key difference is in the oscillation stop (XSTP)
> bit which is inverted on the RX-8035.
>
> Signed-off-by: Mathew McBride <matt@traverse.com.au>
> ---
>  drivers/rtc/rtc-rx8025.c | 59 ++++++++++++++++++++++++++++++++++++----
>  1 file changed, 53 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/rtc/rtc-rx8025.c b/drivers/rtc/rtc-rx8025.c
> index c914091819ba..1a33ec402f4a 100644
> --- a/drivers/rtc/rtc-rx8025.c
> +++ b/drivers/rtc/rtc-rx8025.c
> @@ -60,14 +60,24 @@
>  #define RX8025_ADJ_DATA_MAX    62
>  #define RX8025_ADJ_DATA_MIN    -62
>
> +enum rx_model {
> +       model_rx_unknown,
> +       model_rx_8025,
> +       model_rx_8035,
> +       model_last
> +};
> +
>  static const struct d rx8025_id[] = {
> -       { "rx8025", 0 },
> +       { "rx8025", model_rx_8025 },
> +       { "rx8035", model_rx_8035 },
>         { }
>  };
> +
>  MODULE_DEVICE_TABLE(i2c, rx8025_id);
>
>  struct rx8025_data {
>         struct rtc_device *rtc;
> +       enum rx_model type;

I think 'model' is easier to understand than 'type'.

>         u8 ctrl1;
>  };
>
> @@ -100,10 +110,26 @@ static s32 rx8025_write_regs(const struct i2c_client *client,
>                                               length, values);
>  }
>
> +static int rx8025_is_osc_stopped(enum rx_model model, int ctrl2)
> +{
> +       int xstp = ctrl2 & RX8025_BIT_CTRL2_XST;
> +       /* XSTP bit has different polarity on RX-8025 vs RX-8035.
> +        * RX-8025: 0 == oscillator stopped
> +        * RX-8035: 1 == oscillator stopped
> +        */
> +
> +       if (model == model_rx_8025)
> +               xstp = !xstp;
> +
> +       return xstp;
> +}
> +
>  static int rx8025_check_validity(struct device *dev)
>  {
>         struct i2c_client *client = to_i2c_client(dev);
> +       struct rx8025_data *drvdata = dev_get_drvdata(dev);
>         int ctrl2;
> +       int xstp;
>
>         ctrl2 = rx8025_read_reg(client, RX8025_REG_CTRL2);
>         if (ctrl2 < 0)
> @@ -117,7 +143,8 @@ static int rx8025_check_validity(struct device *dev)
>                 return -EINVAL;
>         }
>
> -       if (!(ctrl2 & RX8025_BIT_CTRL2_XST)) {
> +       xstp = rx8025_is_osc_stopped(drvdata->type, ctrl2);
> +       if (xstp) {
>                 dev_warn(dev, "crystal stopped, date is invalid\n");
>                 return -EINVAL;
>         }
> @@ -125,7 +152,7 @@ static int rx8025_check_validity(struct device *dev)
>         return 0;
>  }
>
> -static int rx8025_reset_validity(struct i2c_client *client)
> +static int rx8025_reset_validity(enum rx_model model, struct i2c_client *client)

We can get the struct rx8025_data by using i2c_get_clientdata().
Therefore, I think that it can be updated without increasing the arguments.

```
struct rx8025_data *rx8025 = i2c_get_clientdata(client);

if (rx8025->type == model_rx_8025)
```

>  {
>         int ctrl2 = rx8025_read_reg(client, RX8025_REG_CTRL2);
>
> @@ -134,8 +161,13 @@ static int rx8025_reset_validity(struct i2c_client *client)
>
>         ctrl2 &= ~(RX8025_BIT_CTRL2_PON | RX8025_BIT_CTRL2_VDET);
>
> +       if (model == model_rx_8025)
> +               ctrl2 |= RX8025_BIT_CTRL2_XST;
> +       else
> +               ctrl2 &= ~(RX8025_BIT_CTRL2_XST);
> +
>         return rx8025_write_reg(client, RX8025_REG_CTRL2,
> -                               ctrl2 | RX8025_BIT_CTRL2_XST);
> +                               ctrl2);
>  }
>
>  static irqreturn_t rx8025_handle_irq(int irq, void *dev_id)
> @@ -149,7 +181,7 @@ static irqreturn_t (int irq, void *dev_id)
>         if (status < 0)
>                 goto out;
>
> -       if (!(status & RX8025_BIT_CTRL2_XST))
> +       if (rx8025_is_osc_stopped(rx8025->type, status))

In rx8025_check_validity(), the return value is put in xstp and confirmed.
I thought it would be better to unify to either one.

>                 dev_warn(&client->dev, "Oscillation stop was detected,"
>                          "you may have to readjust the clock\n");
>
> @@ -241,7 +273,7 @@ static int rx8025_set_time(struct device *dev, struct rtc_time *dt)
>         if (ret < 0)
>                 return ret;
>
> -       return rx8025_reset_validity(client);
> +       return rx8025_reset_validity(rx8025->type, client);
>  }
>
>  static int rx8025_init_client(struct i2c_client *client)
> @@ -519,6 +551,21 @@ static int rx8025_probe(struct i2c_client *client,
>
>         i2c_set_clientdata(client, rx8025);
>
> +       if (id) {
> +               rx8025->type = id->driver_data;
> +               switch (rx8025->type) {
> +               case model_rx_8025:
> +                       dev_info(&client->dev, "Type RX-8025");
> +               break;

Please fix indent.

> +               case model_rx_8035:
> +                       dev_info(&client->dev, "Type RX-8035");
> +                       break;
> +               default:
> +                       dev_warn(&client->dev, "Unknown type: %d\n", rx8025->type);
> +               break;

ditto.

> +               }
> +       }
> +
>         err = rx8025_init_client(client);
>         if (err)
>                 return err;
> --
> 2.30.1
>

Best regards,
  Nobuhiro

-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org / kernel.org}
   GPG ID: 40AD1FA6

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] dt-bindings: rtc: add Epson RX-8025 and RX-8035
  2021-07-07  7:16 ` [PATCH 2/2] dt-bindings: rtc: add Epson RX-8025 and RX-8035 Mathew McBride
@ 2021-07-07 21:46   ` Nobuhiro Iwamatsu
  2021-07-07 21:52     ` Alexandre Belloni
  0 siblings, 1 reply; 9+ messages in thread
From: Nobuhiro Iwamatsu @ 2021-07-07 21:46 UTC (permalink / raw)
  To: Mathew McBride
  Cc: linux-rtc, Alessandro Zummo, Alexandre Belloni, Rob Herring, devicetree

Hi,

2021年7月7日(水) 16:17 Mathew McBride <matt@traverse.com.au>:
>
> These are supported by the rtc-rx8025 module. RX-8025
> also has support in ds1307 due to compatible time registers.
>
> Signed-off-by: Mathew McBride <matt@traverse.com.au>
> ---
>  Documentation/devicetree/bindings/rtc/trivial-rtc.yaml | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml b/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml
> index 7548d8714871..13925bb78ec7 100644
> --- a/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml
> +++ b/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml
> @@ -32,6 +32,9 @@ properties:
>        - dallas,ds3232
>        # I2C-BUS INTERFACE REAL TIME CLOCK MODULE
>        - epson,rx8010
> +      # I2C-BUS INTERFACE REAL TIME CLOCK MODULE
> +      - epson,rx8025
> +      - epson,rx8035

'epson,rx8035' is unnsecessary.
This lists compatible string, so we don't list compatible that doesn't exist.

>        # I2C-BUS INTERFACE REAL TIME CLOCK MODULE with Battery Backed RAM
>        - epson,rx8571
>        # I2C-BUS INTERFACE REAL TIME CLOCK MODULE
> --
> 2.30.1
>

Best regards,
  Nobuhiro


--
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org / kernel.org}
   GPG ID: 40AD1FA6

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] dt-bindings: rtc: add Epson RX-8025 and RX-8035
  2021-07-07 21:46   ` Nobuhiro Iwamatsu
@ 2021-07-07 21:52     ` Alexandre Belloni
  2021-07-09  7:19       ` Nobuhiro Iwamatsu
  0 siblings, 1 reply; 9+ messages in thread
From: Alexandre Belloni @ 2021-07-07 21:52 UTC (permalink / raw)
  To: Nobuhiro Iwamatsu
  Cc: Mathew McBride, linux-rtc, Alessandro Zummo, Rob Herring, devicetree

On 08/07/2021 06:46:31+0900, Nobuhiro Iwamatsu wrote:
> Hi,
> 
> 2021年7月7日(水) 16:17 Mathew McBride <matt@traverse.com.au>:
> >
> > These are supported by the rtc-rx8025 module. RX-8025
> > also has support in ds1307 due to compatible time registers.
> >
> > Signed-off-by: Mathew McBride <matt@traverse.com.au>
> > ---
> >  Documentation/devicetree/bindings/rtc/trivial-rtc.yaml | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml b/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml
> > index 7548d8714871..13925bb78ec7 100644
> > --- a/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml
> > +++ b/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml
> > @@ -32,6 +32,9 @@ properties:
> >        - dallas,ds3232
> >        # I2C-BUS INTERFACE REAL TIME CLOCK MODULE
> >        - epson,rx8010
> > +      # I2C-BUS INTERFACE REAL TIME CLOCK MODULE
> > +      - epson,rx8025
> > +      - epson,rx8035
> 
> 'epson,rx8035' is unnsecessary.
> This lists compatible string, so we don't list compatible that doesn't exist.
> 

Well, the previous patch adds it.


-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] dt-bindings: rtc: add Epson RX-8025 and RX-8035
  2021-07-07 21:52     ` Alexandre Belloni
@ 2021-07-09  7:19       ` Nobuhiro Iwamatsu
  2021-07-10  0:40         ` Alexandre Belloni
  0 siblings, 1 reply; 9+ messages in thread
From: Nobuhiro Iwamatsu @ 2021-07-09  7:19 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Mathew McBride, linux-rtc, Alessandro Zummo, Rob Herring, devicetree

Hi,

2021年7月8日(木) 6:52 Alexandre Belloni <alexandre.belloni@bootlin.com>:
>
> On 08/07/2021 06:46:31+0900, Nobuhiro Iwamatsu wrote:
> > Hi,
> >
> > 2021年7月7日(水) 16:17 Mathew McBride <matt@traverse.com.au>:
> > >
> > > These are supported by the rtc-rx8025 module. RX-8025
> > > also has support in ds1307 due to compatible time registers.
> > >
> > > Signed-off-by: Mathew McBride <matt@traverse.com.au>
> > > ---
> > >  Documentation/devicetree/bindings/rtc/trivial-rtc.yaml | 3 +++
> > >  1 file changed, 3 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml b/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml
> > > index 7548d8714871..13925bb78ec7 100644
> > > --- a/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml
> > > +++ b/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml
> > > @@ -32,6 +32,9 @@ properties:
> > >        - dallas,ds3232
> > >        # I2C-BUS INTERFACE REAL TIME CLOCK MODULE
> > >        - epson,rx8010
> > > +      # I2C-BUS INTERFACE REAL TIME CLOCK MODULE
> > > +      - epson,rx8025
> > > +      - epson,rx8035
> >
> > 'epson,rx8035' is unnsecessary.
> > This lists compatible string, so we don't list compatible that doesn't exist.
> >
>
> Well, the previous patch adds it.
>

I couldn't find anything to add "epson,rx8035" as device tree compatible in
previous patch(rtc: rx8025: implement RX-8035 support)....
I think that i2c_device_id was added and it is not device tree compatible.
Can you tell me if my understanding is wrong?

Best regards,
  Nobuhiro
--
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] dt-bindings: rtc: add Epson RX-8025 and RX-8035
  2021-07-09  7:19       ` Nobuhiro Iwamatsu
@ 2021-07-10  0:40         ` Alexandre Belloni
  2021-07-12  0:02           ` Nobuhiro Iwamatsu
  0 siblings, 1 reply; 9+ messages in thread
From: Alexandre Belloni @ 2021-07-10  0:40 UTC (permalink / raw)
  To: Nobuhiro Iwamatsu
  Cc: Mathew McBride, linux-rtc, Alessandro Zummo, Rob Herring, devicetree

Hello,

On 09/07/2021 16:19:49+0900, Nobuhiro Iwamatsu wrote:
> Hi,
> 
> 2021年7月8日(木) 6:52 Alexandre Belloni <alexandre.belloni@bootlin.com>:
> >
> > On 08/07/2021 06:46:31+0900, Nobuhiro Iwamatsu wrote:
> > > Hi,
> > >
> > > 2021年7月7日(水) 16:17 Mathew McBride <matt@traverse.com.au>:
> > > >
> > > > These are supported by the rtc-rx8025 module. RX-8025
> > > > also has support in ds1307 due to compatible time registers.
> > > >
> > > > Signed-off-by: Mathew McBride <matt@traverse.com.au>
> > > > ---
> > > >  Documentation/devicetree/bindings/rtc/trivial-rtc.yaml | 3 +++
> > > >  1 file changed, 3 insertions(+)
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml b/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml
> > > > index 7548d8714871..13925bb78ec7 100644
> > > > --- a/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml
> > > > +++ b/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml
> > > > @@ -32,6 +32,9 @@ properties:
> > > >        - dallas,ds3232
> > > >        # I2C-BUS INTERFACE REAL TIME CLOCK MODULE
> > > >        - epson,rx8010
> > > > +      # I2C-BUS INTERFACE REAL TIME CLOCK MODULE
> > > > +      - epson,rx8025
> > > > +      - epson,rx8035
> > >
> > > 'epson,rx8035' is unnsecessary.
> > > This lists compatible string, so we don't list compatible that doesn't exist.
> > >
> >
> > Well, the previous patch adds it.
> >
> 
> I couldn't find anything to add "epson,rx8035" as device tree compatible in
> previous patch(rtc: rx8025: implement RX-8035 support)....
> I think that i2c_device_id was added and it is not device tree compatible.
> Can you tell me if my understanding is wrong?

Having "rx8035" in the struct i2c_device_id array is enough to have the
driver probed using DT. IIRC, it is a side effect of
i2c_of_match_device_sysfs()

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] dt-bindings: rtc: add Epson RX-8025 and RX-8035
  2021-07-10  0:40         ` Alexandre Belloni
@ 2021-07-12  0:02           ` Nobuhiro Iwamatsu
  0 siblings, 0 replies; 9+ messages in thread
From: Nobuhiro Iwamatsu @ 2021-07-12  0:02 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Mathew McBride, linux-rtc, Alessandro Zummo, Rob Herring, devicetree

Hi,

2021年7月10日(土) 9:41 Alexandre Belloni <alexandre.belloni@bootlin.com>:
>
> Hello,
>
> On 09/07/2021 16:19:49+0900, Nobuhiro Iwamatsu wrote:
> > Hi,
> >
> > 2021年7月8日(木) 6:52 Alexandre Belloni <alexandre.belloni@bootlin.com>:
> > >
> > > On 08/07/2021 06:46:31+0900, Nobuhiro Iwamatsu wrote:
> > > > Hi,
> > > >
> > > > 2021年7月7日(水) 16:17 Mathew McBride <matt@traverse.com.au>:
> > > > >
> > > > > These are supported by the rtc-rx8025 module. RX-8025
> > > > > also has support in ds1307 due to compatible time registers.
> > > > >
> > > > > Signed-off-by: Mathew McBride <matt@traverse.com.au>
> > > > > ---
> > > > >  Documentation/devicetree/bindings/rtc/trivial-rtc.yaml | 3 +++
> > > > >  1 file changed, 3 insertions(+)
> > > > >
> > > > > diff --git a/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml b/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml
> > > > > index 7548d8714871..13925bb78ec7 100644
> > > > > --- a/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml
> > > > > +++ b/Documentation/devicetree/bindings/rtc/trivial-rtc.yaml
> > > > > @@ -32,6 +32,9 @@ properties:
> > > > >        - dallas,ds3232
> > > > >        # I2C-BUS INTERFACE REAL TIME CLOCK MODULE
> > > > >        - epson,rx8010
> > > > > +      # I2C-BUS INTERFACE REAL TIME CLOCK MODULE
> > > > > +      - epson,rx8025
> > > > > +      - epson,rx8035
> > > >
> > > > 'epson,rx8035' is unnsecessary.
> > > > This lists compatible string, so we don't list compatible that doesn't exist.
> > > >
> > >
> > > Well, the previous patch adds it.
> > >
> >
> > I couldn't find anything to add "epson,rx8035" as device tree compatible in
> > previous patch(rtc: rx8025: implement RX-8035 support)....
> > I think that i2c_device_id was added and it is not device tree compatible.
> > Can you tell me if my understanding is wrong?
>
> Having "rx8035" in the struct i2c_device_id array is enough to have the
> driver probed using DT. IIRC, it is a side effect of
> i2c_of_match_device_sysfs()

I understood. Thanks for the explanation.

Best regards,
  Nobuhiro

-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-07-12  0:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-07  7:16 [PATCH 0/2] Implement EPSON RX-8035 support Mathew McBride
2021-07-07  7:16 ` [PATCH 1/2] rtc: rx8025: implement " Mathew McBride
2021-07-07 21:38   ` Nobuhiro Iwamatsu
2021-07-07  7:16 ` [PATCH 2/2] dt-bindings: rtc: add Epson RX-8025 and RX-8035 Mathew McBride
2021-07-07 21:46   ` Nobuhiro Iwamatsu
2021-07-07 21:52     ` Alexandre Belloni
2021-07-09  7:19       ` Nobuhiro Iwamatsu
2021-07-10  0:40         ` Alexandre Belloni
2021-07-12  0:02           ` Nobuhiro Iwamatsu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.