[RFC,2/3] media: tw9910: Allow the TW9990 to probe

Message ID 20210827130150.909695-2-festevam@gmail.com (mailing list archive)
State RFC, archived
Delegated to: Hans Verkuil
Headers
Series [RFC,1/3] media: tw9910: Allow to probe from device tree |

Commit Message

Fabio Estevam Aug. 27, 2021, 1:01 p.m. UTC
  Currently the driver rejects to probe when the ID is
different from the TW9910 one.

Allow TW9990 to probe by allowing its ID too.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 drivers/media/i2c/tw9910.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Jacopo Mondi Sept. 13, 2021, 9 a.m. UTC | #1
Hi Fabio,

On Fri, Aug 27, 2021 at 10:01:49AM -0300, Fabio Estevam wrote:
> Currently the driver rejects to probe when the ID is
> different from the TW9910 one.
>
> Allow TW9990 to probe by allowing its ID too.
>
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---
>  drivers/media/i2c/tw9910.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/i2c/tw9910.c b/drivers/media/i2c/tw9910.c
> index 04f3c2dbc1cc..0411b8ea9bda 100644
> --- a/drivers/media/i2c/tw9910.c
> +++ b/drivers/media/i2c/tw9910.c
> @@ -859,7 +859,7 @@ static int tw9910_video_probe(struct i2c_client *client)
>  	priv->revision = GET_REV(id);
>  	id = GET_ID(id);
>
> -	if (id != 0x0b || priv->revision > 0x01) {
> +	if ((id != 0x0b && id != 0x00) || priv->revision > 0x01) {

I would define these. Up to you!

>  		dev_err(&client->dev, "Product ID error %x:%x\n",
>  			id, priv->revision);
>  		ret = -ENODEV;
> --
> 2.25.1
>
  

Patch

diff --git a/drivers/media/i2c/tw9910.c b/drivers/media/i2c/tw9910.c
index 04f3c2dbc1cc..0411b8ea9bda 100644
--- a/drivers/media/i2c/tw9910.c
+++ b/drivers/media/i2c/tw9910.c
@@ -859,7 +859,7 @@  static int tw9910_video_probe(struct i2c_client *client)
 	priv->revision = GET_REV(id);
 	id = GET_ID(id);
 
-	if (id != 0x0b || priv->revision > 0x01) {
+	if ((id != 0x0b && id != 0x00) || priv->revision > 0x01) {
 		dev_err(&client->dev, "Product ID error %x:%x\n",
 			id, priv->revision);
 		ret = -ENODEV;