mn88472: implement lock for all delivery systems
Subsystems (2)
PATCH 1/1 mn88472: implement lock for all delivery systems
--- drivers/staging/media/mn88472/mn88472.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-)
drivers/staging/media/mn88472/mn88472.c +20 -3
@@ -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,21 +249,37 @@ 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 */ +msleep (150 ); + ret =regmap_read (dev->regmap[2 ],0x92 , &utmp); +if (ret) + goto err; +if ((utmp&0xF ) >=0x07 ) + *status |=FE_HAS_SIGNAL ; +if ((utmp&0xF ) >=0x0a ) + *status |=FE_HAS_CARRIER ; +if ((utmp&0xF ) >=0x0d ) + *status |=FE_HAS_VITERBI |FE_HAS_SYNC |FE_HAS_LOCK ;break ;case SYS_DVBC_ANNEX_A : ret =regmap_read (dev->regmap[1 ],0x84 , &utmp);if (ret) goto err; +if ((utmp&0xF ) >7 ) + lock =1 ;break ;default : ret = -EINVAL ; goto err; } -if (utmp ==0x08 ) +if (lock) *status =FE_HAS_SIGNAL |FE_HAS_CARRIER |FE_HAS_VITERBI |FE_HAS_SYNC |FE_HAS_LOCK ;
Signature · 1 line
1.9.1
Moikka!
Quoted 18 lines · Benjamin Larsson
Signed-off-by Benjamin Larsson <[email protected]>--- drivers/staging/media/mn88472/mn88472.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-)drivers/staging/media/mn88472/mn88472.c +1
-0@@ -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 ;
drivers/staging/media/mn88472/mn88472.c static int mn88472_read_status(struct dvb_frontend *fe, fe_status_t *status) · line 255
Quoted 7 lines
drivers/staging/media/mn88472/mn88472.c +4
-0@@ -248,21 +249,37 @@ 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 )
You didn't read Kernel coding style doc?
around line 206 Documentation/CodingStyle
---------------------------
Use one space around (on each side of) most binary and ternary operators, such as any of these:
= + - < > * / % | & ^ <= >= == != ? :
---------------------------
drivers/staging/media/mn88472/mn88472.c static int mn88472_read_status(struct dvb_frontend *fe, fe_status_t *status) · line 259
Quoted 6 lines
drivers/staging/media/mn88472/mn88472.c +3
-2+ lock =1 ; +break ;case SYS_DVBT2 : -/* FIXME: implement me */ - utmp =0x08 ;/* DVB-C lock value */ +msleep (150 );
This sleep does not look correct. Why it is here? In order to provide more time for lock waiting? In that case you must increase .get_tune_settings() timeout. On some other case you will need to add comment why such strange thing is needed.
Quoted 16 lines
drivers/staging/media/mn88472/mn88472.c +11
-0+ ret =regmap_read (dev->regmap[2 ],0x92 , &utmp); +if (ret) + goto err; +if ((utmp&0xF ) >=0x07 ) + *status |=FE_HAS_SIGNAL ; +if ((utmp&0xF ) >=0x0a ) + *status |=FE_HAS_CARRIER ; +if ((utmp&0xF ) >=0x0d ) + *status |=FE_HAS_VITERBI |FE_HAS_SYNC |FE_HAS_LOCK ;break ;case SYS_DVBC_ANNEX_A : ret =regmap_read (dev->regmap[1 ],0x84 , &utmp);if (ret) goto err; +if ((utmp&0xF ) >7 ) + lock =1 ;
drivers/staging/media/mn88472/mn88472.c static int mn88472_read_status(struct dvb_frontend *fe, fe_status_t *status) · line 284
Quoted 10 lines
drivers/staging/media/mn88472/mn88472.c +1
-1break ;default : ret = -EINVAL ; goto err; } -if (utmp ==0x08 ) +if (lock) *status =FE_HAS_SIGNAL |FE_HAS_CARRIER |FE_HAS_VITERBI |FE_HAS_SYNC |FE_HAS_LOCK ;
Antti
Signature · 1 line
http://palosaari.fi/
Hello.
Quoted 33 lines · Antti Palosaari
Moikka!
Quoted 19 lines · Benjamin Larsson
Signed-off-by Benjamin Larsson <[email protected]>--- drivers/staging/media/mn88472/mn88472.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-)drivers/staging/media/mn88472/mn88472.c +1
-0@@ -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 ;drivers/staging/media/mn88472/mn88472.c static int mn88472_read_status(struct · line 256
Quoted 8 lines
drivers/staging/media/mn88472/mn88472.c +4
-0@@ -248,21 +249,37 @@ 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 )You didn't read Kernel coding style doc?
Quoted 7 lines
around line 206
Documentation/CodingStyle
---------------------------
Use one space around (on each side of) most binary and ternary operators, such as any of these:= + - < > * / % | & ^ <= >= == != ? :---------------------------
Fixed.
Quoted 9 lines
drivers/staging/media/mn88472/mn88472.c static int mn88472_read_status(struct dvb_frontend *fe, fe_status_t *status) · line 259
Quoted 7 lines
drivers/staging/media/mn88472/mn88472.c +3
-2+ lock =1 ; +break ;case SYS_DVBT2 : -/* FIXME: implement me */ - utmp =0x08 ;/* DVB-C lock value */ +msleep (150 );This sleep does not look correct. Why it is here? In order to provide more time for lock waiting? In that case you must increase .get_tune_settings() timeout. On some other case you will need to add comment why such strange thing is needed.
Increased.
Quoted 23 lines
Quoted 23 lines
drivers/staging/media/mn88472/mn88472.c +11
-0+ ret =regmap_read (dev->regmap[2 ],0x92 , &utmp); +if (ret) + goto err; +if ((utmp&0xF ) >=0x07 ) + *status |=FE_HAS_SIGNAL ; +if ((utmp&0xF ) >=0x0a ) + *status |=FE_HAS_CARRIER ; +if ((utmp&0xF ) >=0x0d ) + *status |=FE_HAS_VITERBI |FE_HAS_SYNC |FE_HAS_LOCK ;break ;case SYS_DVBC_ANNEX_A : ret =regmap_read (dev->regmap[1 ],0x84 , &utmp);if (ret) goto err; +if ((utmp&0xF ) >7 ) + lock =1 ;break ;default : ret = -EINVAL ; goto err; }
Quoted 7 lines
drivers/staging/media/mn88472/mn88472.c static int mn88472_read_status(struct dvb_frontend *fe, fe_status_t *status) · line 284
Quoted 4 lines
drivers/staging/media/mn88472/mn88472.c +1
-1-if (utmp ==0x08 ) +if (lock) *status =FE_HAS_SIGNAL |FE_HAS_CARRIER |FE_HAS_VITERBI |FE_HAS_SYNC |FE_HAS_LOCK ;Antti
Sent v2 patch.
MvH
Benjamin Larsson