Commit 88a67c51 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mauro Carvalho Chehab

V4L/DVB (13653): tw9910: simplify chip ID calculation

Signed-off-by: default avatarKuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 6d74e5f3
...@@ -863,7 +863,7 @@ static int tw9910_video_probe(struct soc_camera_device *icd, ...@@ -863,7 +863,7 @@ static int tw9910_video_probe(struct soc_camera_device *icd,
struct i2c_client *client) struct i2c_client *client)
{ {
struct tw9910_priv *priv = to_tw9910(client); struct tw9910_priv *priv = to_tw9910(client);
s32 val; s32 id;
/* /*
* We must have a parent by now. And it cannot be a wrong one. * We must have a parent by now. And it cannot be a wrong one.
...@@ -889,19 +889,20 @@ static int tw9910_video_probe(struct soc_camera_device *icd, ...@@ -889,19 +889,20 @@ static int tw9910_video_probe(struct soc_camera_device *icd,
* check and show Product ID * check and show Product ID
* So far only revisions 0 and 1 have been seen * So far only revisions 0 and 1 have been seen
*/ */
val = i2c_smbus_read_byte_data(client, ID); id = i2c_smbus_read_byte_data(client, ID);
priv->revision = GET_REV(val); priv->revision = GET_REV(id);
id = GET_ID(id);
if (0x0B != GET_ID(val) || if (0x0B != id ||
0x01 < priv->revision) { 0x01 < priv->revision) {
dev_err(&client->dev, dev_err(&client->dev,
"Product ID error %x:%x\n", "Product ID error %x:%x\n",
GET_ID(val), priv->revision); id, priv->revision);
return -ENODEV; return -ENODEV;
} }
dev_info(&client->dev, dev_info(&client->dev,
"tw9910 Product ID %0x:%0x\n", GET_ID(val), priv->revision); "tw9910 Product ID %0x:%0x\n", id, priv->revision);
icd->vdev->tvnorms = V4L2_STD_NTSC | V4L2_STD_PAL; icd->vdev->tvnorms = V4L2_STD_NTSC | V4L2_STD_PAL;
icd->vdev->current_norm = V4L2_STD_NTSC; icd->vdev->current_norm = V4L2_STD_NTSC;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment