From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: Antti Palosaari <crope@iki.fi>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 5/8] rtl28xxu: add support for Panasonic MN88473 slave demod
Date: Fri, 14 Nov 2014 17:40:05 -0200 [thread overview]
Message-ID: <20141114174005.23a21434@recife.lan> (raw)
In-Reply-To: <1415766190-24482-6-git-send-email-crope@iki.fi>
Em Wed, 12 Nov 2014 06:23:07 +0200
Antti Palosaari <crope@iki.fi> escreveu:
> There is RTL2832P devices having extra MN88473 demodulator. This
> patch add support for such configuration. Logically MN88473 slave
> demodulator is connected to RTL2832 master demodulator, both I2C
> bus and TS input. RTL2832 is integrated to RTL2832U and RTL2832P
> chips. Chip version RTL2832P has extra TS interface for connecting
> slave demodulator.
>
> Signed-off-by: Antti Palosaari <crope@iki.fi>
> ---
> drivers/media/usb/dvb-usb-v2/Kconfig | 1 +
> drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 31 +++++++++++++++++++++++++++++++
> drivers/media/usb/dvb-usb-v2/rtl28xxu.h | 3 ++-
> 3 files changed, 34 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/usb/dvb-usb-v2/Kconfig b/drivers/media/usb/dvb-usb-v2/Kconfig
> index 9050933..f452a11 100644
> --- a/drivers/media/usb/dvb-usb-v2/Kconfig
> +++ b/drivers/media/usb/dvb-usb-v2/Kconfig
> @@ -131,6 +131,7 @@ config DVB_USB_RTL28XXU
> select DVB_RTL2832
> select DVB_RTL2832_SDR if (MEDIA_SUBDRV_AUTOSELECT && MEDIA_SDR_SUPPORT)
> select DVB_MN88472 if MEDIA_SUBDRV_AUTOSELECT
> + select DVB_MN88473 if MEDIA_SUBDRV_AUTOSELECT
> select MEDIA_TUNER_QT1010 if MEDIA_SUBDRV_AUTOSELECT
> select MEDIA_TUNER_MT2060 if MEDIA_SUBDRV_AUTOSELECT
> select MEDIA_TUNER_MXL5005S if MEDIA_SUBDRV_AUTOSELECT
This is not a good idea, as the MN88473 is in staging.
Select is not recursive, and won't select STAGING. Also, we don't want
to enable a staging driver by default on distros.
> diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
> index e3c20f4..93f8afc 100644
> --- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
> +++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
> @@ -25,6 +25,7 @@
> #include "rtl2830.h"
> #include "rtl2832.h"
> #include "mn88472.h"
> +#include "mn88473.h"
>
> #include "qt1010.h"
> #include "mt2060.h"
> @@ -422,6 +423,7 @@ static int rtl2832u_read_config(struct dvb_usb_device *d)
> struct rtl28xxu_req req_r820t = {0x0034, CMD_I2C_RD, 1, buf};
> struct rtl28xxu_req req_r828d = {0x0074, CMD_I2C_RD, 1, buf};
> struct rtl28xxu_req req_mn88472 = {0xff38, CMD_I2C_RD, 1, buf};
> + struct rtl28xxu_req req_mn88473 = {0xff38, CMD_I2C_RD, 1, buf};
>
> dev_dbg(&d->udev->dev, "%s:\n", __func__);
>
> @@ -567,6 +569,13 @@ tuner_found:
> priv->slave_demod = SLAVE_DEMOD_MN88472;
> goto demod_found;
> }
> +
> + ret = rtl28xxu_ctrl_msg(d, &req_mn88473);
> + if (ret == 0 && buf[0] == 0x03) {
> + dev_dbg(&d->udev->dev, "%s: MN88473 found\n", __func__);
> + priv->slave_demod = SLAVE_DEMOD_MN88473;
> + goto demod_found;
> + }
> }
>
> demod_found:
> @@ -889,6 +898,28 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap)
> }
>
> priv->i2c_client_slave_demod = client;
> + } else {
> + struct mn88473_config mn88473_config = {};
> +
> + mn88473_config.fe = &adap->fe[1];
> + mn88473_config.i2c_wr_max = 22,
> + strlcpy(info.type, "mn88473", I2C_NAME_SIZE);
> + info.addr = 0x18;
> + info.platform_data = &mn88473_config;
> + request_module(info.type);
> + client = i2c_new_device(priv->demod_i2c_adapter, &info);
> + if (client == NULL || client->dev.driver == NULL) {
> + priv->slave_demod = SLAVE_DEMOD_NONE;
> + goto err_slave_demod_failed;
> + }
> +
> + if (!try_module_get(client->dev.driver->owner)) {
> + i2c_unregister_device(client);
> + priv->slave_demod = SLAVE_DEMOD_NONE;
> + goto err_slave_demod_failed;
> + }
> +
> + priv->i2c_client_slave_demod = client;
> }
>
> /* override init as we want configure RTL2832 as TS input */
> diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.h b/drivers/media/usb/dvb-usb-v2/rtl28xxu.h
> index 58f2730..9c059ac 100644
> --- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.h
> +++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.h
> @@ -62,7 +62,8 @@ struct rtl28xxu_priv {
> int (*init)(struct dvb_frontend *fe);
> #define SLAVE_DEMOD_NONE 0
> #define SLAVE_DEMOD_MN88472 1
> - unsigned int slave_demod:1;
> + #define SLAVE_DEMOD_MN88473 2
> + unsigned int slave_demod:2;
> };
>
> enum rtl28xxu_chip_id {
next prev parent reply other threads:[~2014-11-14 19:40 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-12 4:23 [PATCH 0/8] Astrometa DVB USB support Antti Palosaari
2014-11-12 4:23 ` [PATCH 1/8] r820t: add DVB-C config Antti Palosaari
2014-11-12 4:23 ` [PATCH 2/8] rtl2832: implement PIP mode Antti Palosaari
2014-11-14 19:34 ` Mauro Carvalho Chehab
2014-11-14 23:36 ` Antti Palosaari
2014-11-16 10:25 ` Mauro Carvalho Chehab
2014-11-16 11:36 ` Benjamin Larsson
2014-11-16 15:09 ` Antti Palosaari
2014-11-12 4:23 ` [PATCH 3/8] rtl28xxu: enable demod ADC only when needed Antti Palosaari
2014-11-12 4:23 ` [PATCH 4/8] rtl28xxu: add support for Panasonic MN88472 slave demod Antti Palosaari
2014-11-14 19:39 ` Mauro Carvalho Chehab
2014-11-14 23:42 ` Antti Palosaari
2014-11-15 1:07 ` Mauro Carvalho Chehab
2014-11-12 4:23 ` [PATCH 5/8] rtl28xxu: add support for Panasonic MN88473 " Antti Palosaari
2014-11-14 19:40 ` Mauro Carvalho Chehab [this message]
2014-11-12 4:23 ` [PATCH 6/8] rtl28xxu: rename tuner I2C client pointer Antti Palosaari
2014-11-12 4:23 ` [PATCH 7/8] rtl28xxu: remove unused SDR attach logic Antti Palosaari
2014-11-12 4:23 ` [PATCH 8/8] rtl28xxu: add SDR module for devices having R828D tuner Antti Palosaari
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=20141114174005.23a21434@recife.lan \
--to=mchehab@osg.samsung.com \
--cc=crope@iki.fi \
--cc=linux-media@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.