diff mbox

[1/4] mn88472: implement dvb-t signal lock

Message ID 1418429925-16342-1-git-send-email-benjamin@southpole.se (mailing list archive)
State New, archived
Headers show

Commit Message

Benjamin Larsson Dec. 13, 2014, 12:18 a.m. UTC
Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
---
 drivers/staging/media/mn88472/mn88472.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Antti Palosaari Dec. 13, 2014, 3:52 a.m. UTC | #1
That breaks DVB-C lock check as old "utmp = 0x08" was set according to 
DVB-C lock check, right?

Antti



On 12/13/2014 02:18 AM, Benjamin Larsson wrote:
> Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
> ---
>   drivers/staging/media/mn88472/mn88472.c | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/mn88472/mn88472.c b/drivers/staging/media/mn88472/mn88472.c
> index 107552a..4d80046 100644
> --- a/drivers/staging/media/mn88472/mn88472.c
> +++ b/drivers/staging/media/mn88472/mn88472.c
> @@ -238,6 +238,7 @@ static int mn88472_read_status(struct dvb_frontend *fe, fe_status_t *status)
>   	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
>   	int ret;
>   	unsigned int utmp;
> +	int lock = 0;
>
>   	*status = 0;
>
> @@ -248,6 +249,12 @@ static int mn88472_read_status(struct dvb_frontend *fe, fe_status_t *status)
>
>   	switch (c->delivery_system) {
>   	case SYS_DVBT:
> +		ret = regmap_read(dev->regmap[0], 0x7F, &utmp);
> +		if (ret)
> +			goto err;
> +		if ((utmp&0xF) > 8)
> +			lock = 1;
> +		break;
>   	case SYS_DVBT2:
>   		/* FIXME: implement me */
>   		utmp = 0x08; /* DVB-C lock value */
> @@ -262,7 +269,7 @@ static int mn88472_read_status(struct dvb_frontend *fe, fe_status_t *status)
>   		goto err;
>   	}
>
> -	if (utmp == 0x08)
> +	if (lock)
>   		*status = FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_VITERBI |
>   				FE_HAS_SYNC | FE_HAS_LOCK;
>
>
Benjamin Larsson Dec. 13, 2014, 11:13 a.m. UTC | #2
On 12/13/2014 04:52 AM, Antti Palosaari wrote:
> That breaks DVB-C lock check as old "utmp = 0x08" was set according to 
> DVB-C lock check, right?
>
> Antti

I have a dvb-c setup now. I will respin this patch with dvb-c support 
tested properly.

MvH
Benjamin Larsson
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/staging/media/mn88472/mn88472.c b/drivers/staging/media/mn88472/mn88472.c
index 107552a..4d80046 100644
--- a/drivers/staging/media/mn88472/mn88472.c
+++ b/drivers/staging/media/mn88472/mn88472.c
@@ -238,6 +238,7 @@  static int mn88472_read_status(struct dvb_frontend *fe, fe_status_t *status)
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	int ret;
 	unsigned int utmp;
+	int lock = 0;
 
 	*status = 0;
 
@@ -248,6 +249,12 @@  static int mn88472_read_status(struct dvb_frontend *fe, fe_status_t *status)
 
 	switch (c->delivery_system) {
 	case SYS_DVBT:
+		ret = regmap_read(dev->regmap[0], 0x7F, &utmp);
+		if (ret)
+			goto err;
+		if ((utmp&0xF) > 8)
+			lock = 1;
+		break;
 	case SYS_DVBT2:
 		/* FIXME: implement me */
 		utmp = 0x08; /* DVB-C lock value */
@@ -262,7 +269,7 @@  static int mn88472_read_status(struct dvb_frontend *fe, fe_status_t *status)
 		goto err;
 	}
 
-	if (utmp == 0x08)
+	if (lock)
 		*status = FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_VITERBI |
 				FE_HAS_SYNC | FE_HAS_LOCK;