From: "Frank Schäfer" <fschaefer.oss@googlemail.com>
To: mchehab@redhat.com
Cc: linux-media@vger.kernel.org,
"Frank Schäfer" <fschaefer.oss@googlemail.com>
Subject: [PATCH v2 4/5] em28xx: fix the i2c adapter functionality flags
Date: Sun, 16 Dec 2012 19:23:30 +0100 [thread overview]
Message-ID: <1355682211-13604-5-git-send-email-fschaefer.oss@googlemail.com> (raw)
In-Reply-To: <1355682211-13604-1-git-send-email-fschaefer.oss@googlemail.com>
I2C_FUNC_SMBUS_EMUL includes flag I2C_FUNC_SMBUS_WRITE_BLOCK_DATA which signals
that up to 31 data bytes can be written to the ic2 client.
But the EM2800 supports only i2c messages with max. 4 data bytes.
I2C_FUNC_IC2 should be set if a master_xfer fucntion pointer is provided in
struct i2c_algorithm.
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
---
drivers/media/usb/em28xx/em28xx-i2c.c | 6 +++++-
1 Datei geändert, 5 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)
diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c
index 940ff4d..7118535 100644
--- a/drivers/media/usb/em28xx/em28xx-i2c.c
+++ b/drivers/media/usb/em28xx/em28xx-i2c.c
@@ -445,7 +445,11 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned char *eedata, int len)
*/
static u32 functionality(struct i2c_adapter *adap)
{
- return I2C_FUNC_SMBUS_EMUL;
+ struct em28xx *dev = adap->algo_data;
+ u32 func_flags = I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
+ if (dev->board.is_em2800)
+ func_flags &= ~I2C_FUNC_SMBUS_WRITE_BLOCK_DATA;
+ return func_flags;
}
static struct i2c_algorithm em28xx_algo = {
--
1.7.10.4
next prev parent reply other threads:[~2012-12-16 18:23 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-16 18:23 [PATCH v2 0/5] em28xx: i2c bug fixes and cleanups Frank Schäfer
2012-12-16 18:23 ` [PATCH v2 1/5] em28xx: clean up the data type mess of the i2c transfer function parameters Frank Schäfer
2012-12-16 18:23 ` [PATCH v2 2/5] em28xx: respect the message size constraints for i2c transfers Frank Schäfer
2012-12-23 0:07 ` Mauro Carvalho Chehab
2012-12-23 13:58 ` Frank Schäfer
2012-12-23 14:46 ` Mauro Carvalho Chehab
2012-12-24 11:09 ` Frank Schäfer
2013-01-02 19:29 ` Antti Palosaari
2013-01-02 21:12 ` Frank Schäfer
2013-01-02 21:15 ` Antti Palosaari
2013-01-02 21:29 ` Frank Schäfer
2013-01-02 21:40 ` Antti Palosaari
2013-01-02 21:52 ` Frank Schäfer
2013-01-02 20:45 ` Sascha Sommer
2013-01-02 21:25 ` Frank Schäfer
2013-01-02 22:21 ` Sascha Sommer
2013-01-03 17:49 ` Frank Schäfer
2012-12-16 18:23 ` [PATCH v2 3/5] em28xx: fix two severe bugs in function em2800_i2c_recv_bytes() Frank Schäfer
2012-12-16 18:23 ` Frank Schäfer [this message]
2012-12-16 18:23 ` [PATCH v2 5/5] em28xx: fix+improve+unify i2c error handling, debug messages and code comments Frank Schäfer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1355682211-13604-5-git-send-email-fschaefer.oss@googlemail.com \
--to=fschaefer.oss@googlemail.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).