diff mbox series

[v2,2/5] rtc-rv8803: add new type for rv8901

Message ID 20250116131532.471040-3-markus.burri@mt.com
State New
Headers show
Series rtc-rv8803: Implement timestamp trigger over event pins | expand

Commit Message

Markus Burri Jan. 16, 2025, 1:15 p.m. UTC
The rtc-rv8901 has additional functionality (tamper detection).
To support this additional functionality the type must be extended.

Signed-off-by: Markus Burri <markus.burri@mt.com>
---
 drivers/rtc/rtc-rv8803.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Comments

Manuel Traut Feb. 19, 2025, 3:33 p.m. UTC | #1
On Thu, Jan 16, 2025 at 02:15:29PM +0100, Markus Burri wrote:
> The rtc-rv8901 has additional functionality (tamper detection).
> To support this additional functionality the type must be extended.
> 
> Signed-off-by: Markus Burri <markus.burri@mt.com>

Reviewed-by: Manuel Traut <manuel.traut@mt.com>

> ---
>  drivers/rtc/rtc-rv8803.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-rv8803.c b/drivers/rtc/rtc-rv8803.c
> index 1327251e5..50fbae931 100644
> --- a/drivers/rtc/rtc-rv8803.c
> +++ b/drivers/rtc/rtc-rv8803.c
> @@ -62,7 +62,8 @@ enum rv8803_type {
>  	rv_8803,
>  	rx_8803,
>  	rx_8804,
> -	rx_8900
> +	rx_8900,
> +	rx_8901,
>  };
>  
>  struct rv8803_data {
> @@ -173,7 +174,8 @@ static int rv8803_regs_reset(struct rv8803_data *rv8803, bool full)
>  	 * The RV-8803 resets all registers to POR defaults after voltage-loss,
>  	 * the Epson RTCs don't, so we manually reset the remainder here.
>  	 */
> -	if (full || rv8803->type == rx_8803 || rv8803->type == rx_8900) {
> +	if (full || rv8803->type == rx_8803 || rv8803->type == rx_8900 ||
> +	    rv8803->type == rx_8901) {
>  		int ret = rv8803_regs_init(rv8803);
>  		if (ret)
>  			return ret;
> @@ -635,6 +637,7 @@ static const struct i2c_device_id rv8803_id[] = {
>  	{ "rv8804", rx_8804 },
>  	{ "rx8803", rx_8803 },
>  	{ "rx8900", rx_8900 },
> +	{ "rx8901", rx_8901 },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(i2c, rv8803_id);
> @@ -760,6 +763,10 @@ static const __maybe_unused struct of_device_id rv8803_of_match[] = {
>  		.compatible = "epson,rx8900",
>  		.data = (void *)rx_8900
>  	},
> +	{
> +		.compatible = "epson,rx8901",
> +		.data = (void *)rx_8901
> +	},
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(of, rv8803_of_match);
> -- 
> 2.39.5
>
diff mbox series

Patch

diff --git a/drivers/rtc/rtc-rv8803.c b/drivers/rtc/rtc-rv8803.c
index 1327251e5..50fbae931 100644
--- a/drivers/rtc/rtc-rv8803.c
+++ b/drivers/rtc/rtc-rv8803.c
@@ -62,7 +62,8 @@  enum rv8803_type {
 	rv_8803,
 	rx_8803,
 	rx_8804,
-	rx_8900
+	rx_8900,
+	rx_8901,
 };
 
 struct rv8803_data {
@@ -173,7 +174,8 @@  static int rv8803_regs_reset(struct rv8803_data *rv8803, bool full)
 	 * The RV-8803 resets all registers to POR defaults after voltage-loss,
 	 * the Epson RTCs don't, so we manually reset the remainder here.
 	 */
-	if (full || rv8803->type == rx_8803 || rv8803->type == rx_8900) {
+	if (full || rv8803->type == rx_8803 || rv8803->type == rx_8900 ||
+	    rv8803->type == rx_8901) {
 		int ret = rv8803_regs_init(rv8803);
 		if (ret)
 			return ret;
@@ -635,6 +637,7 @@  static const struct i2c_device_id rv8803_id[] = {
 	{ "rv8804", rx_8804 },
 	{ "rx8803", rx_8803 },
 	{ "rx8900", rx_8900 },
+	{ "rx8901", rx_8901 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, rv8803_id);
@@ -760,6 +763,10 @@  static const __maybe_unused struct of_device_id rv8803_of_match[] = {
 		.compatible = "epson,rx8900",
 		.data = (void *)rx_8900
 	},
+	{
+		.compatible = "epson,rx8901",
+		.data = (void *)rx_8901
+	},
 	{ }
 };
 MODULE_DEVICE_TABLE(of, rv8803_of_match);