aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends/stb6100.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-02-04[media] dvb_frontend: pass the props cache to get_frontend() as argMauro Carvalho Chehab1-1/+1
Instead of using the DTV properties cache directly, pass the get frontend data as an argument. For now, everything should remain the same, but the next patch will prevent get_frontend to affect the global cache. This is needed because several drivers don't care enough to only change the properties if locked. Due to that, calling G_PROPERTY before locking on those drivers will make them to never lock. Ok, those drivers are crap and should never be merged like that, but the core should not rely that the drivers would be doing the right thing. Reviewed-by: Michael Ira Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-17[media] stb6100: get rid of get_state()/set_state()Mauro Carvalho Chehab1-36/+10
It is tricky to get rid of those ops here, as the stv0299 driver wants to set frequency in separate from setting the bandwidth. So, we use a small trick: we temporarely fill the cache with 0 for either frequency or bandwidth and add some logic at set_params to only change the property(ies) that aren't zero. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-17[media] stb6100: get rid of tuner_state at struct stb6100_stateMauro Carvalho Chehab1-5/+4
The stb6100 driver has a struct tuner_state on its state struct, that it is used only to store the bandwidth. Even so, this struct is not really used, as every time the bandwidth is get or set, it goes through the hardware. So, get rid of that. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-17[media] dvb_frontend.h: get rid of unused tuner params/statesMauro Carvalho Chehab1-17/+6
There are several tuner_param values that aren't by any driver or core: DVBFE_TUNER_TUNERSTEP DVBFE_TUNER_IFFREQ DVBFE_TUNER_REFCLOCK DVBFE_TUNER_IQSENSE DVBFE_TUNER_DUMMY Several of those correspond to the values at the tuner_state struct with is also only initialized by not used anyware: u32 tunerstep; u32 ifreq; u32 refclock; It doesn't make sense to keep anything at the kABI that it is not used. So, get rid of them. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-02-28[media] stb6100: fix buffer length check in stb6100_write_reg_range()Alexander Shiyan1-1/+1
We are checking sizeof() the wrong variable! Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-11-08[media] dvb-frontends: Don't use dynamic static allocationMauro Carvalho Chehab1-1/+10
Dynamic static allocation is evil, as Kernel stack is too low, and compilation complains about it on some archs: drivers/media/dvb-frontends/bcm3510.c:230:1: warning: 'bcm3510_do_hab_cmd' uses dynamic stack allocation [enabled by default] drivers/media/dvb-frontends/itd1000.c:69:1: warning: 'itd1000_write_regs.constprop.0' uses dynamic stack allocation [enabled by default] drivers/media/dvb-frontends/mt312.c:126:1: warning: 'mt312_write' uses dynamic stack allocation [enabled by default] drivers/media/dvb-frontends/nxt200x.c:111:1: warning: 'nxt200x_writebytes' uses dynamic stack allocation [enabled by default] drivers/media/dvb-frontends/stb6100.c:216:1: warning: 'stb6100_write_reg_range.constprop.3' uses dynamic stack allocation [enabled by default] drivers/media/dvb-frontends/stv6110.c:98:1: warning: 'stv6110_write_regs' uses dynamic stack allocation [enabled by default] drivers/media/dvb-frontends/stv6110x.c:85:1: warning: 'stv6110x_write_regs' uses dynamic stack allocation [enabled by default] drivers/media/dvb-frontends/tda18271c2dd.c:147:1: warning: 'WriteRegs' uses dynamic stack allocation [enabled by default] drivers/media/dvb-frontends/zl10039.c:119:1: warning: 'zl10039_write' uses dynamic stack allocation [enabled by default] Instead, let's enforce a limit for the buffer. Considering that I2C transfers are generally limited, and that devices used on USB has a max data length of 64 bytes for the control URBs. So, it seem safe to use 64 bytes as the hard limit for all those devices. On most cases, the limit is a way lower than that, but this limit is small enough to not affect the Kernel stack, and it is a no brain limit, as using smaller ones would require to either carefully each driver or to take a look on each datasheet. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com> Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2012-10-06[media] drivers/media/dvb-frontends/stb6100.c: Removes useless kfree()Peter Senna Tschudin1-6/+2
Remove useless kfree() and clean up code related to the removal. The semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r exists@ position p1,p2; expression x; @@ if (x@p1 == NULL) { ... kfree@p2(x); ... return ...; } @unchanged exists@ position r.p1,r.p2; expression e <= r.x,x,e1; iterator I; statement S; @@ if (x@p1 == NULL) { ... when != I(x,...) S when != e = e1 when != e += e1 when != e -= e1 when != ++e when != --e when != e++ when != e-- when != &e kfree@p2(x); ... return ...; } @ok depends on unchanged exists@ position any r.p1; position r.p2; expression x; @@ ... when != true x@p1 == NULL kfree@p2(x); @depends on !ok && unchanged@ position r.p2; expression x; @@ *kfree@p2(x); // </smpl> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13[media] move the dvb/frontends to drivers/media/dvb-frontendsMauro Carvalho Chehab1-0/+611
Raise the DVB frontends one level up, as the intention is to remove the drivers/media/dvb directory. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>