mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: i2c: ov13858: Enable clock frequency macro
@ 2025-04-06 14:43 Sunny Patel
  2025-04-15 12:03 ` Sakari Ailus
  0 siblings, 1 reply; 6+ messages in thread
From: Sunny Patel @ 2025-04-06 14:43 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Mauro Carvalho Chehab, linux-media, linux-kernel, Sunny Patel

Defines a macro `OV13858_MCLK` for the clock frequency (19200000 Hz).
Replaces the hardcoded clock frequency value in the probe function.

Signed-off-by: Sunny Patel <nueralspacetech@gmail.com>
---
 drivers/media/i2c/ov13858.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ov13858.c b/drivers/media/i2c/ov13858.c
index 7a3fc1d28514..a1242a90cdc9 100644
--- a/drivers/media/i2c/ov13858.c
+++ b/drivers/media/i2c/ov13858.c
@@ -21,6 +21,8 @@
 #define OV13858_REG_SOFTWARE_RST	0x0103
 #define OV13858_SOFTWARE_RST		0x01
 
+#define OV13858_MCLK				19200000
+
 /* PLL1 generates PCLK and MIPI_PHY_CLK */
 #define OV13858_REG_PLL1_CTRL_0		0x0300
 #define OV13858_REG_PLL1_CTRL_1		0x0301
@@ -1664,7 +1666,7 @@ static int ov13858_probe(struct i2c_client *client)
 	u32 val = 0;
 
 	device_property_read_u32(&client->dev, "clock-frequency", &val);
-	if (val != 19200000)
+	if (val != OV13858_MCLK)
 		return -EINVAL;
 
 	ov13858 = devm_kzalloc(&client->dev, sizeof(*ov13858), GFP_KERNEL);
-- 
2.43.0


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

* Re: [PATCH] media: i2c: ov13858: Enable clock frequency macro
  2025-04-06 14:43 [PATCH] media: i2c: ov13858: Enable clock frequency macro Sunny Patel
@ 2025-04-15 12:03 ` Sakari Ailus
  2025-04-23 14:49   ` Sunny Patel
                     ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Sakari Ailus @ 2025-04-15 12:03 UTC (permalink / raw)
  To: Sunny Patel; +Cc: Mauro Carvalho Chehab, linux-media, linux-kernel

Hi Sunny,

On Sun, Apr 06, 2025 at 08:13:22PM +0530, Sunny Patel wrote:
> Defines a macro `OV13858_MCLK` for the clock frequency (19200000 Hz).
> Replaces the hardcoded clock frequency value in the probe function.

Thanks for the patch.

While the patch seems fine, the subject and the commit message would
benefit from some attention. For instance, don't use third person without a
subject. Please see examples in existing commit messages, too.

The clock seems to be called "EXTCLK" in the datasheet, too.

> 
> Signed-off-by: Sunny Patel <nueralspacetech@gmail.com>
> ---
>  drivers/media/i2c/ov13858.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/ov13858.c b/drivers/media/i2c/ov13858.c
> index 7a3fc1d28514..a1242a90cdc9 100644
> --- a/drivers/media/i2c/ov13858.c
> +++ b/drivers/media/i2c/ov13858.c
> @@ -21,6 +21,8 @@
>  #define OV13858_REG_SOFTWARE_RST	0x0103
>  #define OV13858_SOFTWARE_RST		0x01
>  
> +#define OV13858_MCLK				19200000
> +
>  /* PLL1 generates PCLK and MIPI_PHY_CLK */
>  #define OV13858_REG_PLL1_CTRL_0		0x0300
>  #define OV13858_REG_PLL1_CTRL_1		0x0301
> @@ -1664,7 +1666,7 @@ static int ov13858_probe(struct i2c_client *client)
>  	u32 val = 0;
>  
>  	device_property_read_u32(&client->dev, "clock-frequency", &val);
> -	if (val != 19200000)
> +	if (val != OV13858_MCLK)
>  		return -EINVAL;
>  
>  	ov13858 = devm_kzalloc(&client->dev, sizeof(*ov13858), GFP_KERNEL);

-- 
Kind regards,

Sakari Ailus

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

* [PATCH] media: i2c: ov13858: Enable clock frequency macro
  2025-04-15 12:03 ` Sakari Ailus
@ 2025-04-23 14:49   ` Sunny Patel
  2025-04-23 14:53   ` [PATCH V2] media: i2c: ov13858: Define macro for EXTCLK frequency Sunny Patel
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Sunny Patel @ 2025-04-23 14:49 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Mauro Carvalho Chehab, linux-media, linux-kernel, Sunny Patel

Defines a macro `OV13858_MCLK` for the clock frequency (19200000 Hz).
Replaces the hardcoded clock frequency value in the probe function.

Signed-off-by: Sunny Patel <nueralspacetech@gmail.com>

Thanks for the feedback. I have revised the commit message to use
correct terminology

---
 drivers/media/i2c/ov13858.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ov13858.c b/drivers/media/i2c/ov13858.c
index 7a3fc1d28514..a1242a90cdc9 100644
--- a/drivers/media/i2c/ov13858.c
+++ b/drivers/media/i2c/ov13858.c
@@ -21,6 +21,8 @@
 #define OV13858_REG_SOFTWARE_RST	0x0103
 #define OV13858_SOFTWARE_RST		0x01
 
+#define OV13858_MCLK				19200000
+
 /* PLL1 generates PCLK and MIPI_PHY_CLK */
 #define OV13858_REG_PLL1_CTRL_0		0x0300
 #define OV13858_REG_PLL1_CTRL_1		0x0301
@@ -1664,7 +1666,7 @@ static int ov13858_probe(struct i2c_client *client)
 	u32 val = 0;
 
 	device_property_read_u32(&client->dev, "clock-frequency", &val);
-	if (val != 19200000)
+	if (val != OV13858_MCLK)
 		return -EINVAL;
 
 	ov13858 = devm_kzalloc(&client->dev, sizeof(*ov13858), GFP_KERNEL);
-- 
2.43.0


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

* [PATCH V2] media: i2c: ov13858: Define macro for EXTCLK frequency
  2025-04-15 12:03 ` Sakari Ailus
  2025-04-23 14:49   ` Sunny Patel
@ 2025-04-23 14:53   ` Sunny Patel
  2025-04-23 15:02   ` [PATCH] media: i2c: ov13858: Enable clock frequency macro Sunny Patel
  2025-04-25  3:07   ` Sunny Patel
  3 siblings, 0 replies; 6+ messages in thread
From: Sunny Patel @ 2025-04-23 14:53 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Mauro Carvalho Chehab, linux-media, linux-kernel, Sunny Patel

Defines a macro `OV13858_EXTCLK` for the clock frequency (19.2 MHz)
and use it instead of the hardcoded value in the probe function.

Signed-off-by: Sunny Patel <nueralspacetech@gmail.com>

Thanks for the feedback. I have revised the commit message to use
correct terminology

---
 drivers/media/i2c/ov13858.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ov13858.c b/drivers/media/i2c/ov13858.c
index 7a3fc1d28514..a1242a90cdc9 100644
--- a/drivers/media/i2c/ov13858.c
+++ b/drivers/media/i2c/ov13858.c
@@ -21,6 +21,8 @@
 #define OV13858_REG_SOFTWARE_RST	0x0103
 #define OV13858_SOFTWARE_RST		0x01
 
+#define OV13858_MCLK				19200000
+
 /* PLL1 generates PCLK and MIPI_PHY_CLK */
 #define OV13858_REG_PLL1_CTRL_0		0x0300
 #define OV13858_REG_PLL1_CTRL_1		0x0301
@@ -1664,7 +1666,7 @@ static int ov13858_probe(struct i2c_client *client)
 	u32 val = 0;
 
 	device_property_read_u32(&client->dev, "clock-frequency", &val);
-	if (val != 19200000)
+	if (val != OV13858_MCLK)
 		return -EINVAL;
 
 	ov13858 = devm_kzalloc(&client->dev, sizeof(*ov13858), GFP_KERNEL);
-- 
2.43.0


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

* [PATCH] media: i2c: ov13858: Enable clock frequency macro
  2025-04-15 12:03 ` Sakari Ailus
  2025-04-23 14:49   ` Sunny Patel
  2025-04-23 14:53   ` [PATCH V2] media: i2c: ov13858: Define macro for EXTCLK frequency Sunny Patel
@ 2025-04-23 15:02   ` Sunny Patel
  2025-04-25  3:07   ` Sunny Patel
  3 siblings, 0 replies; 6+ messages in thread
From: Sunny Patel @ 2025-04-23 15:02 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Mauro Carvalho Chehab, linux-media, linux-kernel, Sunny Patel

Define a macro `OV13858_EXTCLK` for the clock frequency (19.2 MHz)
and use it instead of the hardcoded value in the probe function.

Signed-off-by: Sunny Patel <nueralspacetech@gmail.com>

Thanks for the feedback. I have revised the commit message to use
correct terminology. And please discard the privious mail as it doesn't
have correct patch file.

---
 drivers/media/i2c/ov13858.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ov13858.c b/drivers/media/i2c/ov13858.c
index 7a3fc1d28514..a1242a90cdc9 100644
--- a/drivers/media/i2c/ov13858.c
+++ b/drivers/media/i2c/ov13858.c
@@ -21,6 +21,8 @@
 #define OV13858_REG_SOFTWARE_RST	0x0103
 #define OV13858_SOFTWARE_RST		0x01
 
+#define OV13858_MCLK				19200000
+
 /* PLL1 generates PCLK and MIPI_PHY_CLK */
 #define OV13858_REG_PLL1_CTRL_0		0x0300
 #define OV13858_REG_PLL1_CTRL_1		0x0301
@@ -1664,7 +1666,7 @@ static int ov13858_probe(struct i2c_client *client)
 	u32 val = 0;
 
 	device_property_read_u32(&client->dev, "clock-frequency", &val);
-	if (val != 19200000)
+	if (val != OV13858_MCLK)
 		return -EINVAL;
 
 	ov13858 = devm_kzalloc(&client->dev, sizeof(*ov13858), GFP_KERNEL);
-- 
2.43.0


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

* [PATCH] media: i2c: ov13858: Enable clock frequency macro
  2025-04-15 12:03 ` Sakari Ailus
                     ` (2 preceding siblings ...)
  2025-04-23 15:02   ` [PATCH] media: i2c: ov13858: Enable clock frequency macro Sunny Patel
@ 2025-04-25  3:07   ` Sunny Patel
  3 siblings, 0 replies; 6+ messages in thread
From: Sunny Patel @ 2025-04-25  3:07 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Mauro Carvalho Chehab, linux-media, linux-kernel, Sunny Patel

Define a macro `OV13858_EXTCLK` for the clock frequency (19.2 MHz)
and use it instead of the hardcoded value in the probe function.

Signed-off-by: Sunny Patel <nueralspacetech@gmail.com>

---
 drivers/media/i2c/ov13858.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ov13858.c b/drivers/media/i2c/ov13858.c
index 7a3fc1d28514..a1242a90cdc9 100644
--- a/drivers/media/i2c/ov13858.c
+++ b/drivers/media/i2c/ov13858.c
@@ -21,6 +21,8 @@
 #define OV13858_REG_SOFTWARE_RST	0x0103
 #define OV13858_SOFTWARE_RST		0x01
 
+#define OV13858_MCLK				19200000
+
 /* PLL1 generates PCLK and MIPI_PHY_CLK */
 #define OV13858_REG_PLL1_CTRL_0		0x0300
 #define OV13858_REG_PLL1_CTRL_1		0x0301
@@ -1664,7 +1666,7 @@ static int ov13858_probe(struct i2c_client *client)
 	u32 val = 0;
 
 	device_property_read_u32(&client->dev, "clock-frequency", &val);
-	if (val != 19200000)
+	if (val != OV13858_MCLK)
 		return -EINVAL;
 
 	ov13858 = devm_kzalloc(&client->dev, sizeof(*ov13858), GFP_KERNEL);
-- 
2.43.0


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

end of thread, other threads:[~2025-04-25  3:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-06 14:43 [PATCH] media: i2c: ov13858: Enable clock frequency macro Sunny Patel
2025-04-15 12:03 ` Sakari Ailus
2025-04-23 14:49   ` Sunny Patel
2025-04-23 14:53   ` [PATCH V2] media: i2c: ov13858: Define macro for EXTCLK frequency Sunny Patel
2025-04-23 15:02   ` [PATCH] media: i2c: ov13858: Enable clock frequency macro Sunny Patel
2025-04-25  3:07   ` Sunny Patel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®