Patch "[media] m88ds3103: use own reg update_bits() implementation" has been added to the 4.2-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
[media] m88ds3103: use own reg update_bits() implementation
to the 4.2-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
m88ds3103-use-own-reg-update_bits-implementation.patch
and it can be found in the queue-4.2 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
56ea37da3b93dfe46cb5c3ee0ee4cc44229ece47Mon Sep 17 00:00:00 2001
From: Antti Palosaari <[email protected]>
Date: Sat, 3 Oct 2015 18:35:14 -0300
Subject: [media] m88ds3103: use own reg update_bits() implementation
From: Antti Palosaari <[email protected]>
commit 56ea37da3b93dfe46cb5c3ee0ee4cc44229ece47 upstream.
Device stopped to tuning some channels after regmap conversion. Reason is that regmap_update_bits() works a bit differently for partially volatile registers than old homemade routine. Return back to old routine in order to fix issue.
--- drivers/media/dvb-frontends/m88ds3103.c | 73 ++++++++++++++++++++------------ 1 file changed, 47 insertions(+), 26 deletions(-)
drivers/media/dvb-frontends/m88ds3103.c +47 -26
@@ -18,6 +18,27 @@static struct dvb_frontend_ops m88ds3103_ops; +/* write single register with mask */ +static int m88ds3103_update_bits (struct m88ds3103_dev *dev, +u8 reg,u8 mask,u8 val) +{ +int ret; +u8 tmp; + +/* no need for read if whole reg is written */ +if (mask !=0xff ) { + ret =regmap_bulk_read (dev->regmap, reg, &tmp,1 ); +if (ret) +return ret; + + val &= mask; + tmp &= ~mask; + val |= tmp; + } + +return regmap_bulk_write (dev->regmap, reg, &val,1 ); +} +/* write reg val table using reg addr auto increment */ static int m88ds3103_wr_reg_val_tab (struct m88ds3103_dev *dev,const struct m88ds3103_reg_val *tab,int tab_len)
@@ -394,10 +415,10 @@ static int m88ds3103_set_frontend(struct u8tmp2 =0x00 ;/* 0b00 */ break ; } - ret =regmap_update_bits (dev->regmap,0x22 ,0xc0 , u8tmp1 <<6 ); + ret =m88ds3103_update_bits (dev,0x22 ,0xc0 , u8tmp1 <<6 );if (ret) goto err; - ret =regmap_update_bits (dev->regmap,0x24 ,0xc0 , u8tmp2 <<6 ); + ret =m88ds3103_update_bits (dev,0x24 ,0xc0 , u8tmp2 <<6 );if (ret) goto err; }
@@ -455,13 +476,13 @@ static int m88ds3103_set_frontend(structif (ret) goto err; } - ret =regmap_update_bits (dev->regmap,0x9d ,0x08 ,0x08 ); + ret =m88ds3103_update_bits (dev,0x9d ,0x08 ,0x08 );if (ret) goto err; ret =regmap_write (dev->regmap,0xf1 ,0x01 );if (ret) goto err; - ret =regmap_update_bits (dev->regmap,0x30 ,0x80 ,0x80 ); + ret =m88ds3103_update_bits (dev,0x30 ,0x80 ,0x80 );if (ret) goto err; }
@@ -498,7 +519,7 @@ static int m88ds3103_set_frontend(structswitch (dev->cfg->ts_mode) {case M88DS3103_TS_SERIAL :case M88DS3103_TS_SERIAL_D7 : - ret =regmap_update_bits (dev->regmap,0x29 ,0x20 , u8tmp1); + ret =m88ds3103_update_bits (dev,0x29 ,0x20 , u8tmp1);if (ret) goto err; u8tmp1 =0 ;
@@ -567,11 +588,11 @@ static int m88ds3103_set_frontend(structif (ret) goto err; - ret =regmap_update_bits (dev->regmap,0x4d ,0x02 , dev->cfg->spec_inv <<1 ); + ret =m88ds3103_update_bits (dev,0x4d ,0x02 , dev->cfg->spec_inv <<1 );if (ret) goto err; - ret =regmap_update_bits (dev->regmap,0x30 ,0x10 , dev->cfg->agc_inv <<4 ); + ret =m88ds3103_update_bits (dev,0x30 ,0x10 , dev->cfg->agc_inv <<4 );if (ret) goto err;
@@ -625,13 +646,13 @@ static int m88ds3103_init(struct dvb_fro dev->warm = false;/* wake up device from sleep */ - ret =regmap_update_bits (dev->regmap,0x08 ,0x01 ,0x01 ); + ret =m88ds3103_update_bits (dev,0x08 ,0x01 ,0x01 );if (ret) goto err; - ret =regmap_update_bits (dev->regmap,0x04 ,0x01 ,0x00 ); + ret =m88ds3103_update_bits (dev,0x04 ,0x01 ,0x00 );if (ret) goto err; - ret =regmap_update_bits (dev->regmap,0x23 ,0x10 ,0x00 ); + ret =m88ds3103_update_bits (dev,0x23 ,0x10 ,0x00 );if (ret) goto err;
@@ -749,18 +770,18 @@ static int m88ds3103_sleep(struct dvb_fr utmp =0x29 ; else utmp =0x27 ; - ret =regmap_update_bits (dev->regmap, utmp,0x01 ,0x00 ); + ret =m88ds3103_update_bits (dev, utmp,0x01 ,0x00 );if (ret) goto err;/* sleep */ - ret =regmap_update_bits (dev->regmap,0x08 ,0x01 ,0x00 ); + ret =m88ds3103_update_bits (dev,0x08 ,0x01 ,0x00 );if (ret) goto err; - ret =regmap_update_bits (dev->regmap,0x04 ,0x01 ,0x01 ); + ret =m88ds3103_update_bits (dev,0x04 ,0x01 ,0x01 );if (ret) goto err; - ret =regmap_update_bits (dev->regmap,0x23 ,0x10 ,0x10 ); + ret =m88ds3103_update_bits (dev,0x23 ,0x10 ,0x10 );if (ret) goto err;
@@ -992,12 +1013,12 @@ static int m88ds3103_set_tone(struct dvb } utmp = tone <<7 | dev->cfg->envelope_mode <<5 ; - ret =regmap_update_bits (dev->regmap,0xa2 ,0xe0 , utmp); + ret =m88ds3103_update_bits (dev,0xa2 ,0xe0 , utmp);if (ret) goto err; utmp =1 <<2 ; - ret =regmap_update_bits (dev->regmap,0xa1 , reg_a1_mask, utmp); + ret =m88ds3103_update_bits (dev,0xa1 , reg_a1_mask, utmp);if (ret) goto err;
@@ -1047,7 +1068,7 @@ static int m88ds3103_set_voltage(struct voltage_dis ^= dev->cfg->lnb_en_pol; utmp = voltage_dis <<1 | voltage_sel <<0 ; - ret =regmap_update_bits (dev->regmap,0xa2 ,0x03 , utmp); + ret =m88ds3103_update_bits (dev,0xa2 ,0x03 , utmp);if (ret) goto err;
@@ -1080,7 +1101,7 @@ static int m88ds3103_diseqc_send_master_ } utmp = dev->cfg->envelope_mode <<5 ; - ret =regmap_update_bits (dev->regmap,0xa2 ,0xe0 , utmp); + ret =m88ds3103_update_bits (dev,0xa2 ,0xe0 , utmp);if (ret) goto err;
@@ -1115,12 +1136,12 @@ static int m88ds3103_diseqc_send_master_ }else {dev_dbg (&client->dev,"diseqc tx timeout\n" ); - ret =regmap_update_bits (dev->regmap,0xa1 ,0xc0 ,0x40 ); + ret =m88ds3103_update_bits (dev,0xa1 ,0xc0 ,0x40 );if (ret) goto err; } - ret =regmap_update_bits (dev->regmap,0xa2 ,0xc0 ,0x80 ); + ret =m88ds3103_update_bits (dev,0xa2 ,0xc0 ,0x80 );if (ret) goto err;
@@ -1152,7 +1173,7 @@ static int m88ds3103_diseqc_send_burst(s } utmp = dev->cfg->envelope_mode <<5 ; - ret =regmap_update_bits (dev->regmap,0xa2 ,0xe0 , utmp); + ret =m88ds3103_update_bits (dev,0xa2 ,0xe0 , utmp);if (ret) goto err;
@@ -1194,12 +1215,12 @@ static int m88ds3103_diseqc_send_burst(s }else {dev_dbg (&client->dev,"diseqc tx timeout\n" ); - ret =regmap_update_bits (dev->regmap,0xa1 ,0xc0 ,0x40 ); + ret =m88ds3103_update_bits (dev,0xa1 ,0xc0 ,0x40 );if (ret) goto err; } - ret =regmap_update_bits (dev->regmap,0xa2 ,0xc0 ,0x80 ); + ret =m88ds3103_update_bits (dev,0xa2 ,0xc0 ,0x80 );if (ret) goto err;
@@ -1435,13 +1456,13 @@ static int m88ds3103_probe(struct i2c_cl goto err_kfree;/* sleep */ - ret =regmap_update_bits (dev->regmap,0x08 ,0x01 ,0x00 ); + ret =m88ds3103_update_bits (dev,0x08 ,0x01 ,0x00 );if (ret) goto err_kfree; - ret =regmap_update_bits (dev->regmap,0x04 ,0x01 ,0x01 ); + ret =m88ds3103_update_bits (dev,0x04 ,0x01 ,0x01 );if (ret) goto err_kfree; - ret =regmap_update_bits (dev->regmap,0x23 ,0x10 ,0x10 ); + ret =m88ds3103_update_bits (dev,0x23 ,0x10 ,0x10 );if (ret) goto err_kfree;
Patches currently in stable-queue which might be from [email protected] are
queue-4.2/si2168-bounds-check-firmware.patch queue-4.2/rtl28xxu-fix-control-message-flaws.patch queue-4.2/m88ds3103-use-own-reg-update_bits-implementation.patch