summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-03-04[media] drx-j: Avoid any regressions by preserving old behaviorMauro Carvalho Chehab1-5/+4
The version is initialized with zero at drx_driver.c. Keep it, in order to avoid the risk of causing any regression. While here, remove the drx_driver.h from drxj, as this is not required there. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: get rid of drx_driver.cMauro Carvalho Chehab3-657/+593
This file contains just the firmware load code, that it is also somewhat duplicated at drxj.c. Move the code into there. Latter patches will remove the duplicated code. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: prepend function names with drx_ at drx_driver.cMauro Carvalho Chehab1-14/+14
In order to prepare to get rid of drx_driver.c, prepend all functions there with drx_. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: Some cleanups at drx_driver.c sourceMauro Carvalho Chehab2-153/+118
This is mostly CodingStyle fixes and improvements. No functional changes. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: Allow standard selectionMauro Carvalho Chehab1-2/+27
ClearQAM is currently not working. Add support for it too. Unlikely other ATSC tuners, though, this device will not auto-detect between ATSC and ClearQAM. So, the delivery system should be properly set. Also, this frontend seems to also support DVB-C annex A/C. Add experimental support for them. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: reset the DVB scan configuration at powerupMauro Carvalho Chehab1-71/+80
Without this fixup, the DRX-J will not be properly initialized, loosing several PIDs. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: get rid of its own be??_to_cpu() implementationMauro Carvalho Chehab1-70/+16
Instead of handling endiannes with its own internal way, use the already existing macros. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: remove unused code from drx_driver.cMauro Carvalho Chehab2-792/+1
There are several drx-j code there that are never used, as they don't even fit into Linux DVB subystem model. Remove them, in order to simplify the code. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] em28xx: add support for PCTV 80e remote controllerMauro Carvalho Chehab1-0/+1
This stick uses the same RC-5 remote controll found on other PCTV devices. So, just use the existing keymap. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: Split firmware size check from the main routineMauro Carvalho Chehab1-93/+122
The firmware upload routine is already complex enough. Split the first loop that verifies the firmware size into a separate routine, making the code more readable. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: dynamically load the firmwareMauro Carvalho Chehab8-12236/+181
Instead of hardcoding the firmware files together with the driver, use request_firmware() way, loading it from userspace. The firmware files are placed at: http://linuxtv.org/downloads/firmware/#8 And they'll be latter submitted to linux-firmware git tree. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: Be sure that all allocated data are properly initializedMauro Carvalho Chehab1-10/+9
The state struct is allocated without cleaning the memory. This causes random bugs. Clean it, and move the memcpy functions just below each kalloc, to be clearer that all those data are properly filled. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: Fix release and error path on drx39xxj.cMauro Carvalho Chehab1-12/+19
There are memory leaks on both DVB release and dvb attach error path. Fix them. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: remove the useless microcode_sizeMauro Carvalho Chehab2-11/+3
This var is not used. Remove it from the code, as we'll now be converting the driver to load the firmware from an external file. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: make checkpatch.pl happyMauro Carvalho Chehab7-428/+325
Fix the remaining checkpatch.pl compliants at drxj. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: remove drxj_options.hMauro Carvalho Chehab2-69/+0
This file is empty (actually, all commented there). So, remove it. We should latter remove those macros too, or convert them into a struct to allow dynamically enable the options during device probing time. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: remove typedefs at drx_driver.cMauro Carvalho Chehab1-5/+4
Get rid of another typedef defined on this driver. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: get rid of some ugly macrosMauro Carvalho Chehab3-349/+14
There are several get/set macros that are bogus: they just call another macro and do either: x = FOO(d) or FOO(d) = x As checkpatch complains about that, and replacing all of them are as easy as running a small coccinelle script, get rid of all of them. Script used: @@ expression d, x; @@ -DRX_SET_MIRRORFREQSPECT(d, x); +DRX_ATTR_MIRRORFREQSPECT(d) = x; @@ expression d, x; @@ -DRX_GET_MIRRORFREQSPECT(d, x); +x = DRX_ATTR_MIRRORFREQSPECT(d); @@ expression d, x; @@ -DRX_SET_CURRENTPOWERMODE(d, x); +DRX_ATTR_CURRENTPOWERMODE(d) = x; @@ expression d, x; @@ -DRX_GET_CURRENTPOWERMODE(d, x); +x = DRX_ATTR_CURRENTPOWERMODE(d); @@ expression d, x; @@ -DRX_SET_MICROCODE(d, x); +DRX_ATTR_MICROCODE(d) = x; @@ expression d, x; @@ -DRX_GET_MICROCODE(d, x); +x = DRX_ATTR_MICROCODE(d); @@ expression d, x; @@ -DRX_SET_MICROCODESIZE(d, x); +DRX_ATTR_MICROCODESIZE(d) = x; @@ expression d, x; @@ -DRX_GET_MICROCODESIZE(d, x); +x = DRX_ATTR_MICROCODESIZE(d); @@ expression d, x; @@ -DRX_SET_VERIFYMICROCODE(d, x); +DRX_ATTR_VERIFYMICROCODE(d) = x; @@ expression d, x; @@ -DRX_GET_VERIFYMICROCODE(d, x); +x = DRX_ATTR_VERIFYMICROCODE(d); @@ expression d, x; @@ -DRX_SET_MCVERTYPE(d, x); +DRX_ATTR_MCRECORD(d).aux_type = x; @@ expression d, x; @@ -DRX_GET_MCVERTYPE(d, x); +x = DRX_ATTR_MCRECORD(d).aux_type; @@ expression d, x; @@ -DRX_SET_MCDEV(d, x); +DRX_ATTR_MCRECORD(d).mc_dev_type = x; @@ expression d, x; @@ -DRX_GET_MCDEV(d, x); +x = DRX_ATTR_MCRECORD(d).mc_dev_type; @@ expression d, x; @@ -DRX_SET_MCVERSION(d, x); +DRX_ATTR_MCRECORD(d).mc_version = x; @@ expression d, x; @@ -DRX_GET_MCVERSION(d, x); +x = DRX_ATTR_MCRECORD(d).mc_version; @@ expression d, x; @@ -DRX_SET_MCPATCH(d, x); +DRX_ATTR_MCRECORD(d).mc_base_version = x; @@ expression d, x; @@ -DRX_GET_MCPATCH(d, x); +x = DRX_ATTR_MCRECORD(d).mc_base_version; @@ expression d, x; @@ -DRX_SET_I2CADDR(d, x); +DRX_ATTR_I2CADDR(d) = x; @@ expression d, x; @@ -DRX_GET_I2CADDR(d, x); +x = DRX_ATTR_I2CADDR(d); @@ expression d, x; @@ -DRX_SET_I2CDEVID(d, x); +DRX_ATTR_I2CDEVID(d) = x; @@ expression d, x; @@ -DRX_GET_I2CDEVID(d, x); +x = DRX_ATTR_I2CDEVID(d); @@ expression d, x; @@ -DRX_SET_USEBOOTLOADER(d, x); +DRX_ATTR_USEBOOTLOADER(d) = x; @@ expression d, x; @@ -DRX_GET_USEBOOTLOADER(d, x); +x = DRX_ATTR_USEBOOTLOADER(d); @@ expression d, x; @@ -DRX_SET_CURRENTSTANDARD(d, x); +DRX_ATTR_CURRENTSTANDARD(d) = x; @@ expression d, x; @@ -DRX_GET_CURRENTSTANDARD(d, x); +x = DRX_ATTR_CURRENTSTANDARD(d); @@ expression d, x; @@ -DRX_SET_PREVSTANDARD(d, x); +DRX_ATTR_PREVSTANDARD(d) = x; @@ expression d, x; @@ -DRX_GET_PREVSTANDARD(d, x); +x = DRX_ATTR_PREVSTANDARD(d); @@ expression d, x; @@ -DRX_SET_CACHESTANDARD(d, x); +DRX_ATTR_CACHESTANDARD(d) = x; @@ expression d, x; @@ -DRX_GET_CACHESTANDARD(d, x); +x = DRX_ATTR_CACHESTANDARD(d); @@ expression d, x; @@ -DRX_SET_CURRENTCHANNEL(d, x); +DRX_ATTR_CURRENTCHANNEL(d) = x; @@ expression d, x; @@ -DRX_GET_CURRENTCHANNEL(d, x); +x = DRX_ATTR_CURRENTCHANNEL(d); @@ expression d, x; @@ -DRX_SET_ISOPENED(d, x); +DRX_ATTR_ISOPENED(d) = x; @@ expression d, x; @@ -DRX_GET_ISOPENED(d, x); +x = DRX_ATTR_ISOPENED(d); @@ expression d, x; @@ -DRX_SET_TUNER(d, x); +DRX_ATTR_TUNER(d) = x; @@ expression d, x; @@ -DRX_GET_TUNER(d, x); +x = DRX_ATTR_TUNER(d); @@ expression d, x; @@ -DRX_SET_CAPABILITIES(d, x); +DRX_ATTR_CAPABILITIES(d) = x; @@ expression d, x; @@ -DRX_GET_CAPABILITIES(d, x); +x = DRX_ATTR_CAPABILITIES(d); @@ expression d, x; @@ -DRX_SET_PRODUCTID(d, x); +DRX_ATTR_PRODUCTID(d) = x; @@ expression d, x; @@ -DRX_GET_PRODUCTID(d, x); +x = DRX_ATTR_PRODUCTID(d); @@ expression d, x; @@ -DRX_SET_MFX(d, x); +DRX_ATTR_PRODUCTID(d) = x; @@ expression d, x; @@ -DRX_GET_MFX(d, x); +x = DRX_ATTR_PRODUCTID(d); @@ expression d, x; @@ -DRX_SET_INTERMEDIATEFREQ(d, x); +DRX_ATTR_INTERMEDIATEFREQ(d) = x; @@ expression d, x; @@ -DRX_GET_INTERMEDIATEFREQ(d, x); +x = DRX_ATTR_INTERMEDIATEFREQ(d); @@ expression d, x; @@ -DRX_SET_SYSCLOCKFREQ(d, x); +DRX_ATTR_SYSCLOCKFREQ(d) = x; @@ expression d, x; @@ -DRX_GET_SYSCLOCKFREQ(d, x); +x = DRX_ATTR_SYSCLOCKFREQ(d); @@ expression d, x; @@ -DRX_SET_TUNERRFAGCPOL(d, x); +DRX_ATTR_TUNERRFAGCPOL(d) = x; @@ expression d, x; @@ -DRX_GET_TUNERRFAGCPOL(d, x); +x = DRX_ATTR_TUNERRFAGCPOL(d); @@ expression d, x; @@ -DRX_SET_TUNERIFAGCPOL(d, x); +DRX_ATTR_TUNERIFAGCPOL(d) = x; @@ expression d, x; @@ -DRX_GET_TUNERIFAGCPOL(d, x); +x = DRX_ATTR_TUNERIFAGCPOL(d); @@ expression d, x; @@ -DRX_SET_TUNERSLOWMODE(d, x); +DRX_ATTR_TUNERSLOWMODE(d) = x; @@ expression d, x; @@ -DRX_GET_TUNERSLOWMODE(d, x); +x = DRX_ATTR_TUNERSLOWMODE(d); @@ expression d, x; @@ -DRX_SET_TUNERPORTNR(d, x); +DRX_ATTR_TUNERSPORTNR(d) = x; Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: Replace printk's by pr_foo()Mauro Carvalho Chehab3-22/+26
Instead of using printk's, use the pr_foo() macros. That fixes some checkpatch warnings and provide a better error, warning and debug support. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: Use the Linux error codesMauro Carvalho Chehab7-2140/+2122
Instead of defining its own set of error codes, use the linux native ones. Please note that this patch made a "stupid" error code mapping, just replacing the codes with the closest one. In special, -EIO is being used on several places. I'm pretty sure this could be better assigned, but a change like that would require lots o time and efforts, without much benefit. So lets do adjstments at the error codes latter, when we have more time. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: CodingStyle fixups on drxj.cMauro Carvalho Chehab3-1044/+749
Fix almost all checkpatch.pl warnings/errors on drxj.c, except for: - 80 cols whitespacing; - too many leading tabs; - a false positive at DRXJ_16TO8() macro. - static char array declaration should probably be static const char as adding "const" would cause warnings. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: Remove typedefs in drxj.cMauro Carvalho Chehab1-15/+12
Remove three typedefs from drxj.c, using the following script: use File::Find; use strict; my $dir = shift or die "need a dir"; my $type = shift or die "need type"; my $var = shift or die "need var"; sub handle_file { my $file = shift; my $out; open IN, $file or die "can't open $file"; $out .= $_ while (<IN>); close IN; $out =~ s/\btypedef\s+($type)\s+\{([\d\D]+?)\s*\}\s+\b($var)[^\;]+\;/$type $var \{\2\};/; # This replaces the typedef declaration for a simple struct declaration - style 1 # This replaces the typedef declaration for a simple struct declaration - style 2 # Replace struct occurrences $out =~ s,\b($var)_t\s+,$type \1 ,g; $out =~ s,\bp_*($var)_t\s+,$type \1 *,g; $out =~ s,\b($var)_t\b,$type \1,g; $out =~ s,\bp_*($var)_t\b,$type \1 *,g; open OUT, ">$file" or die "can't open $file"; print OUT $out; close OUT; } sub parse_dir { my $file = $File::Find::name; return if (!($file =~ /.[ch]$/)); handle_file $file; } find({wanted => \&parse_dir, no_chdir => 1}, $dir); Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: More CamelCase fixupsMauro Carvalho Chehab5-85/+85
Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: Simplify logic expressionsMauro Carvalho Chehab2-64/+64
Don't need to test boolean x == true or x == false. That makes the code more compact. patch generated with make coccicheck and manually reviewed. While here, remove uneeded ';'. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: don't use parenthesis on returnMauro Carvalho Chehab3-407/+407
CodingStyle fix: don't use parenthesis on return, as it is not a function. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: replace the ugly CHK_ERROR() macroMauro Carvalho Chehab1-1727/+6755
Using return and goto inside macros is ugly and makes harder to understand the code and the labels. Remove those macros, and add a proper error debug message, when something bad happens. This was generated using the following coccinelle script: @@ @@ -DUMMY_READ(); +do { + u16 dummy; + RR16(demod->my_i2c_dev_addr, SCU_RAM_VERSION_HI__A, &dummy); +} while (0); @@ expression dev, addr, val; @@ -WR16(dev, addr, val) +CHK_ERROR(DRXJ_DAP.write_reg16func(dev, addr, val, 0)) @@ expression dev, addr, val; @@ -RR16(dev, addr, val) +CHK_ERROR(DRXJ_DAP.read_reg16func(dev, addr, val, 0)) @@ expression dev, addr, val; @@ -WR32(dev, addr, val) +CHK_ERROR(DRXJ_DAP.write_reg32func(dev, addr, val, 0)) @@ expression dev, addr, val; @@ -RR32(dev, addr, val) +CHK_ERROR(DRXJ_DAP.read_reg32func(dev, addr, val, 0)) @@ expression dev, addr, val, block; @@ -WRB(dev, addr, val, block) +CHK_ERROR(DRXJ_DAP.write_block_func(dev, addr, val, block, 0)) @@ expression dev, addr, val, block; @@ -RRB(dev, addr, val, block) +CHK_ERROR(DRXJ_DAP.read_block_func(dev, addr, val, block, 0)) @@ expression dev, addr, val; @@ -BCWR16(dev, addr, val) +CHK_ERROR(DRXJ_DAP.write_reg16func(dev, addr, val, DRXDAP_FASI_BROADCAST)) @@ expression dev, addr, val; @@ -ARR32(dev, addr, val) +CHK_ERROR(drxj_dap_atomic_read_reg32(dev, addr, val, 0)) @@ expression dev, addr, val; @@ -SARR16(dev, addr, val) +CHK_ERROR(drxj_dap_scu_atomic_read_reg16(dev, addr, val, 0)) @@ expression x; @@ -CHK_ERROR(x); +rc = x; +if (rc != DRX_STS_OK) { + pr_err("error %d\n", rc); + goto rw_error; +} Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: Don't use buffer if an error occursMauro Carvalho Chehab1-0/+5
drivers/media/dvb-frontends/drx39xyj/drxj.c: In function ‘drxj_dap_scu_atomic_read_reg16’: drivers/media/dvb-frontends/drx39xyj/drxj.c:4170:9: warning: ‘*((void *)&buf+1)’ may be used uninitialized in this function [-Wmaybe-uninitialized] word = (u16) (buf[0] + (buf[1] << 8)); ^ drivers/media/dvb-frontends/drx39xyj/drxj.c:4170:9: warning: ‘buf’ may be used uninitialized in this function [-Wmaybe-uninitialized] drivers/media/dvb-frontends/drx39xyj/drxj.c: In function ‘drxj_dap_atomic_read_reg32.isra.59’: drivers/media/dvb-frontends/drx39xyj/drxj.c:2186:7: warning: ‘*((void *)&buf+3)’ may be used uninitialized in this function [-Wmaybe-uninitialized] word = (u32) buf[3]; ^ drivers/media/dvb-frontends/drx39xyj/drxj.c:2188:10: warning: ‘*((void *)&buf+2)’ may be used uninitialized in this function [-Wmaybe-uninitialized] word |= (u32) buf[2]; ^ drivers/media/dvb-frontends/drx39xyj/drxj.c:2190:10: warning: ‘*((void *)&buf+1)’ may be used uninitialized in this function [-Wmaybe-uninitialized] word |= (u32) buf[1]; ^ drivers/media/dvb-frontends/drx39xyj/drxj.c:2192:10: warning: ‘buf’ may be used uninitialized in this function [-Wmaybe-uninitialized] word |= (u32) buf[0]; ^ Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: a few more CodingStyle fixupsMauro Carvalho Chehab2-3/+3
Some whitespace cleanups. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: Get rid of typedefs on drxh.hMauro Carvalho Chehab3-416/+379
This were fixed with the help of this small perl script: #!/usr/bin/perl my $dir = shift or die "need a dir"; my $type = shift or die "need type"; my $var = shift or die "need var"; sub handle_file { my $file = shift; my $out; open IN, $file or die "can't open $file"; $out .= $_ while (<IN>); close IN; $out =~ s/\btypedef\s+($type)\s+\{([\d\D]+?)\s*\}\s+\b($var)[^\;]+\;/$type $var \{\2\};/; $out =~ s,\b($var)_t\s+,$type \1 ,g; $out =~ s,\bp_*($var)_t\s+,$type \1 *,g; $out =~ s,\b($var)_t\b,$type \1,g; $out =~ s,\bp_*($var)_t\b,$type \1 *,g; open OUT, ">$file" or die "can't open $file"; print OUT $out; close OUT; } sub parse_dir { my $file = $File::Find::name; return if (!($file =~ /.[ch]$/)); handle_file $file; } find({wanted => \&parse_dir, no_chdir => 1}, $dir); Some manual work were needed. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: get rid of typedefs in drx_driver.hMauro Carvalho Chehab8-1119/+999
Most of the changes were done with scripts like: for i in drivers/media/dvb-frontends/drx39xyj/*.[ch]; do perl -ne '$var = "drx_sig_quality"; s,\b($var)_t\s+,struct \1 ,g; s,\bp_*($var)_t\s+,struct \1 *,g; s,\b($var)_t\b,struct \1,g; s,\bp_*($var)_t\b,struct \1 *,g; print $_' <$i >a && mv a $i; done Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: Get rid of drx39xyj/bsp_tuner.hMauro Carvalho Chehab1-204/+0
This file is not used anywhere. Drop it. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: make a few functions staticMauro Carvalho Chehab1-2/+2
drivers/media/dvb-frontends/drx39xyj/drx_driver.c:181:7: warning: no previous prototype for 'get_scan_context' [-Wmissing-prototypes] void *get_scan_context(pdrx_demod_instance_t demod, void *scan_context) drivers/media/dvb-frontends/drx39xyj/drx_driver.c: At top level: drivers/media/dvb-frontends/drx39xyj/drx_driver.c:842:5: warning: no previous prototype for 'ctrl_dump_registers' [-Wmissing-prototypes] int ctrl_dump_registers(pdrx_demod_instance_t demod, Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: Some minor CodingStyle fixes at headersMauro Carvalho Chehab2-21/+10
No functional changes. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: Remove a bunch of unused but assigned varsMauro Carvalho Chehab1-107/+29
None of those vars are used on those functions. Just remove them. After this patch, there's just one of such warnings: drivers/media/dvb-frontends/drx39xyj/drxj.c: In function 'ctrl_get_qam_sig_quality': drivers/media/dvb-frontends/drx39xyj/drxj.c:7872:6: warning: variable 'ber_cnt' set but not used [-Wunused-but-set-variable] u32 ber_cnt = 0; /* BER count */ We'll keep it, as BER count will be useful when converting the frontend to report statistics via DVBv5 API Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: remove the unused tuner_i2c_write_read() functionMauro Carvalho Chehab1-16/+0
This function is not static. Also, it is not used anywhere. So, drop it. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: do more CodingStyle fixesMauro Carvalho Chehab12-188/+188
This time, use checkpatch --strict --fix. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: Don't use CamelCaseMauro Carvalho Chehab13-6844/+6844
There's no reason at all to use CamelCase here. Convert all of them to normal case. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: Use checkpatch --fix to solve several issuesMauro Carvalho Chehab9-649/+649
Instead of manually fixing the issues, use the --fix experimental checkpatch. That solves a bunch of checkpatch issues. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: fix whitespacing on pointer parmametersMauro Carvalho Chehab2-12/+12
Patch generated with this script: for i in drivers/media/dvb-frontends/drx39xyj/*.[ch]; do perl -ne 's,(enum|struct|void|int|u32|u64|u16|u8|s8|s16|s32|s64)\s+(\S+)\s+\*[ ]+,\1 \2 *,g; print $_' <$i >a && mv a $i; done Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: get rid of most of the typedefsMauro Carvalho Chehab8-948/+918
There are lots of typedefs there. Let's get rid of them. Most of the work here is due to this small script: if [ "$3" == "" ]; then echo "usage: $0 type DRXName drx_name" fi t=$1; f=$2; g=$3 for i in *.[ch]; do sed s,"p${f}_t","$t $g *",g <$i >a && mv a $i && \ sed s,"${f}_t","$t $g",g <$i >a && mv a $i done Just kept there the function typedefs, as those are still useful. Yet, all those tuner_ops can likely be just removed on a latter cleanup patch. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: get rid of the bsp*.h headersMauro Carvalho Chehab7-143/+249
Move them into drx_driver.h That makes easier to cleanup further what's there at the headers. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: get rid of the other typedefs at bsp_types.hMauro Carvalho Chehab9-788/+701
Most of the work were done by those small scripts: for i in *; do sed s,pDRXFrequency_t,"s32 *",g <$i >a && mv a $i; done for i in *; do sed s,DRXFrequency_t,"s32",g <$i >a && mv a $i; done for i in *; do sed s,pDRXSymbolrate_t,"u32 *",g <$i >a && mv a $i; done for i in *; do sed s,DRXSymbolrate_t,"u32",g <$i >a && mv a $i; done for i in *; do sed s,FALSE,false,g <$i >a && mv a $i; done for i in *; do sed s,TRUE,true,g <$i >a && mv a $i; done for i in *; do sed s,Bool_t,bool,g <$i >a && mv a $i; done for i in *; do sed s,pbool,"bool *",g <$i >a && mv a $i; done The only remaining things there are the return values. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: get rid of the integer typedefsMauro Carvalho Chehab13-1270/+1182
Patch created using this small script: for j in 8 16 32; do for i in *; do sed s,pu${j}_t,"u$j *",g <$i >a && mv a $i; done; done for j in 8 16 32; do for i in *; do sed s,ps${j}_t,"s$j *",g <$i >a && mv a $i; done; done for j in 8 16 32; do for i in *; do sed s,s${j}_t,"s$j",g <$i >a && mv a $i; done; done for j in 8 16 32; do for i in *; do sed s,u${j}_t,"u$j",g <$i >a && mv a $i; done; done and fixing the bsp_types.h header. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: remove the "const" annotate on HICommand()Mauro Carvalho Chehab1-2/+2
After removing the typedef, it is now clear that HICommand() were abusing of a var that was expecting to be constant: drivers/media/dvb-frontends/drx39xyj/drxj.c: In function ‘HICommand’: drivers/media/dvb-frontends/drx39xyj/drxj.c:2272:3: warning: passing argument 1 of ‘drxDapDRXJFunct_g.writeReg16Func’ discards ‘const’ qualifier from pointer target type [enabled by default] drivers/media/dvb-frontends/drx39xyj/drxj.c:2272:3: note: expected ‘struct i2c_device_addr *’ but argument is of type ‘const struct i2c_device_addr *’ drivers/media/dvb-frontends/drx39xyj/drxj.c:2273:3: warning: passing argument 1 of ‘drxDapDRXJFunct_g.writeReg16Func’ discards ‘const’ qualifier from pointer target type [enabled by default] drivers/media/dvb-frontends/drx39xyj/drxj.c:2273:3: note: expected ‘struct i2c_device_addr *’ but argument is of type ‘const struct i2c_device_addr *’ drivers/media/dvb-frontends/drx39xyj/drxj.c:2274:3: warning: passing argument 1 of ‘drxDapDRXJFunct_g.writeReg16Func’ discards ‘const’ qualifier from pointer target type [enabled by default] drivers/media/dvb-frontends/drx39xyj/drxj.c:2274:3: note: expected ‘struct i2c_device_addr *’ but argument is of type ‘const struct i2c_device_addr *’ drivers/media/dvb-frontends/drx39xyj/drxj.c:2275:3: warning: passing argument 1 of ‘drxDapDRXJFunct_g.writeReg16Func’ discards ‘const’ qualifier from pointer target type [enabled by default] drivers/media/dvb-frontends/drx39xyj/drxj.c:2275:3: note: expected ‘struct i2c_device_addr *’ but argument is of type ‘const struct i2c_device_addr *’ drivers/media/dvb-frontends/drx39xyj/drxj.c:2278:3: warning: passing argument 1 of ‘drxDapDRXJFunct_g.writeReg16Func’ discards ‘const’ qualifier from pointer target type [enabled by default] drivers/media/dvb-frontends/drx39xyj/drxj.c:2278:3: note: expected ‘struct i2c_device_addr *’ but argument is of type ‘const struct i2c_device_addr *’ drivers/media/dvb-frontends/drx39xyj/drxj.c:2279:3: warning: passing argument 1 of ‘drxDapDRXJFunct_g.writeReg16Func’ discards ‘const’ qualifier from pointer target type [enabled by default] drivers/media/dvb-frontends/drx39xyj/drxj.c:2279:3: note: expected ‘struct i2c_device_addr *’ but argument is of type ‘const struct i2c_device_addr *’ drivers/media/dvb-frontends/drx39xyj/drxj.c:2291:2: warning: passing argument 1 of ‘drxDapDRXJFunct_g.writeReg16Func’ discards ‘const’ qualifier from pointer target type [enabled by default] drivers/media/dvb-frontends/drx39xyj/drxj.c:2291:2: note: expected ‘struct i2c_device_addr *’ but argument is of type ‘const struct i2c_device_addr *’ drivers/media/dvb-frontends/drx39xyj/drxj.c:2311:4: warning: passing argument 1 of ‘drxDapDRXJFunct_g.readReg16Func’ discards ‘const’ qualifier from pointer target type [enabled by default] drivers/media/dvb-frontends/drx39xyj/drxj.c:2311:4: note: expected ‘struct i2c_device_addr *’ but argument is of type ‘const struct i2c_device_addr *’ drivers/media/dvb-frontends/drx39xyj/drxj.c:2315:3: warning: passing argument 1 of ‘drxDapDRXJFunct_g.readReg16Func’ discards ‘const’ qualifier from pointer target type [enabled by default] drivers/media/dvb-frontends/drx39xyj/drxj.c:2315:3: note: expected ‘struct i2c_device_addr *’ but argument is of type ‘const struct i2c_device_addr *’ Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: get rid of the typedefs on bsp_i2c.hMauro Carvalho Chehab9-281/+238
Most of the hard work here were done by this small script: for i in *; do sed s,pI2CDeviceAddr_t,"struct i2c_device_addr *",g <$i >a && mv a $i; done for i in *; do sed s,I2CDeviceAddr_t,"struct i2c_device_addr",g <$i >a && mv a $i; done Only bsp_i2c.h were added by hand. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: Fix CodingStyleMauro Carvalho Chehab2-56/+35
Make checkpatch.pl happy. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: Fix compilation and un-comment itMauro Carvalho Chehab4-13/+8
There were some DVB internal API changes, since this driver were written. Change it to work with the new API. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: CodingStyle fixesMauro Carvalho Chehab19-21562/+26522
Do the automatic CodingStyle fixes found at Lindent. No functional changes. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: put under 3-clause BSD licenseDevin Heitmueller18-517/+484
Relicense the drx-j driver under a standard 3-clause BSD license, which makes it GPL compatible. This was done explicitly with permission from Trident Microsystems. Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: add a driver for Trident drx-j frontendDevin Heitmueller27-0/+45627
Add support for the Trident DRX-J driver, including a card profile for the PCTV 80e which uses the chip. Thanks to Trident for allowing the release of this code under a BSD license, and of course Hauppauge/PCTV for pushing for its release to the community. [pdickeybeta@gmail.com: modified to fix compilation errors and also to move the driver files from the drx39xy subdirectory to the frontends directory] [m.chehab@samsung.com: fix merge conflicts, commented drx-j compilation and added EM28XX_R06_I2C_CLK setup also to the board setup] Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>