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 4/5] em28xx: make em28xx_set_outfmt() working with EM25xx family bridges
Date: Sun, 3 Mar 2013 20:41:00 +0100 [thread overview]
Message-ID: <1362339661-3446-5-git-send-email-fschaefer.oss@googlemail.com> (raw)
In-Reply-To: <1362339661-3446-1-git-send-email-fschaefer.oss@googlemail.com>
Streaming doesn't work with the EM2765 if bit 5 of the output format register
0x27 is set.
It's actually not clear if really has to be set for the other chips, but for
now let's keep it to avoid regressions and add a comment to the code.
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
---
drivers/media/usb/em28xx/em28xx-core.c | 20 +++++++++++++++-----
1 Datei geändert, 15 Zeilen hinzugefügt(+), 5 Zeilen entfernt(-)
diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c
index b2dcb3d..7b9f76b 100644
--- a/drivers/media/usb/em28xx/em28xx-core.c
+++ b/drivers/media/usb/em28xx/em28xx-core.c
@@ -697,12 +697,22 @@ int em28xx_vbi_supported(struct em28xx *dev)
int em28xx_set_outfmt(struct em28xx *dev)
{
int ret;
- u8 vinctrl;
-
- ret = em28xx_write_reg_bits(dev, EM28XX_R27_OUTFMT,
- dev->format->reg | 0x20, 0xff);
+ u8 fmt, vinctrl;
+
+ fmt = dev->format->reg;
+ if (!dev->is_em25xx)
+ fmt |= 0x20;
+ /* NOTE: it's not clear if this is really needed !
+ * The datasheets say bit 5 is a reserved bit and devices seem to work
+ * fine without it. But the Windows driver sets it for em2710/50+em28xx
+ * devices and we've always been setting it, too.
+ *
+ * em2765 (em25xx, em276x/7x/8x ?) devices do NOT work with this bit set,
+ * it's likely used for an additional (compressed ?) format there.
+ */
+ ret = em28xx_write_reg(dev, EM28XX_R27_OUTFMT, fmt);
if (ret < 0)
- return ret;
+ return ret;
ret = em28xx_write_reg(dev, EM28XX_R10_VINMODE, dev->vinmode);
if (ret < 0)
--
1.7.10.4
next prev parent reply other threads:[~2013-03-03 19:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-03 19:40 [PATCH 0/5] em28xx: add support for the em2765 bridge Frank Schäfer
2013-03-03 19:40 ` [PATCH 1/5] em28xx: add support for em25xx i2c bus B read/write/check device operations Frank Schäfer
2013-03-04 20:20 ` Mauro Carvalho Chehab
2013-03-04 20:23 ` Mauro Carvalho Chehab
2013-03-04 21:31 ` Frank Schäfer
2013-03-04 21:35 ` Frank Schäfer
2013-03-03 19:40 ` [PATCH 2/5] em28xx: add chip id of the em2765 Frank Schäfer
2013-03-03 19:40 ` [PATCH 3/5] em28xx: add support for em25xx/em276x/em277x/em278x frame data processing Frank Schäfer
2013-03-03 19:41 ` Frank Schäfer [this message]
2013-03-03 19:41 ` [PATCH 5/5] em28xx: write output frame resolution to regs 0x34+0x35 for em25xx family bridges 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=1362339661-3446-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).