aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2015-11-30 07:26:35 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-12-18 10:34:32 -0500
commite69d89420e2297a896056bb29746a27d98d9b111 (patch)
treec2924c7398a3cbf16ea8e7973a1af8c4987af651
parent499ebed3ec3854687ccf160d0f262191be990720 (diff)
[media] cx25840: fix cx25840_s_stream for cx2388x and cx231xx
For those two devices the code wrote to addresses 0x115/6, but on those devices those addresses have nothing to do with power controls. So clearly this never worked. Rather than writing to bogus addresses, just do nothing for the cx2388x and cx231xx. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/i2c/cx25840/cx25840-core.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/drivers/media/i2c/cx25840/cx25840-core.c b/drivers/media/i2c/cx25840/cx25840-core.c
index d8b5343cb80a..a8b1a03d3158 100644
--- a/drivers/media/i2c/cx25840/cx25840-core.c
+++ b/drivers/media/i2c/cx25840/cx25840-core.c
@@ -1716,26 +1716,27 @@ static int cx25840_s_stream(struct v4l2_subdev *sd, int enable)
1716 1716
1717 v4l_dbg(1, cx25840_debug, client, "%s video output\n", 1717 v4l_dbg(1, cx25840_debug, client, "%s video output\n",
1718 enable ? "enable" : "disable"); 1718 enable ? "enable" : "disable");
1719
1720 /*
1721 * It's not clear what should be done for these devices.
1722 * The original code used the same addresses as for the cx25840, but
1723 * those addresses do something else entirely on the cx2388x and
1724 * cx231xx. Since it never did anything in the first place, just do
1725 * nothing.
1726 */
1727 if (is_cx2388x(state) || is_cx231xx(state))
1728 return 0;
1729
1719 if (enable) { 1730 if (enable) {
1720 if (is_cx2388x(state) || is_cx231xx(state)) { 1731 v = cx25840_read(client, 0x115) | 0x0c;
1721 v = cx25840_read(client, 0x421) | 0x0b; 1732 cx25840_write(client, 0x115, v);
1722 cx25840_write(client, 0x421, v); 1733 v = cx25840_read(client, 0x116) | 0x04;
1723 } else { 1734 cx25840_write(client, 0x116, v);
1724 v = cx25840_read(client, 0x115) | 0x0c;
1725 cx25840_write(client, 0x115, v);
1726 v = cx25840_read(client, 0x116) | 0x04;
1727 cx25840_write(client, 0x116, v);
1728 }
1729 } else { 1735 } else {
1730 if (is_cx2388x(state) || is_cx231xx(state)) { 1736 v = cx25840_read(client, 0x115) & ~(0x0c);
1731 v = cx25840_read(client, 0x421) & ~(0x0b); 1737 cx25840_write(client, 0x115, v);
1732 cx25840_write(client, 0x421, v); 1738 v = cx25840_read(client, 0x116) & ~(0x04);
1733 } else { 1739 cx25840_write(client, 0x116, v);
1734 v = cx25840_read(client, 0x115) & ~(0x0c);
1735 cx25840_write(client, 0x115, v);
1736 v = cx25840_read(client, 0x116) & ~(0x04);
1737 cx25840_write(client, 0x116, v);
1738 }
1739 } 1740 }
1740 return 0; 1741 return 0;
1741} 1742}