1. 05 3月, 2014 28 次提交
    • M
      [media] drx-j: remove drxj_options.h · c361fda0
      Mauro Carvalho Chehab 提交于
      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: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      c361fda0
    • M
      [media] drx-j: get rid of some ugly macros · b8cbcd35
      Mauro Carvalho Chehab 提交于
      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: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      b8cbcd35
    • M
      [media] drx-j: Replace printk's by pr_foo() · 935c6654
      Mauro Carvalho Chehab 提交于
      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: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      935c6654
    • M
      [media] drx-j: Use the Linux error codes · 9482354f
      Mauro Carvalho Chehab 提交于
      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: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      9482354f
    • M
      [media] drx-j: CodingStyle fixups on drxj.c · 63713517
      Mauro Carvalho Chehab 提交于
      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: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      63713517
    • M
      [media] drx-j: Remove typedefs in drxj.c · 60d3603b
      Mauro Carvalho Chehab 提交于
      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: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      60d3603b
    • M
    • M
      [media] drx-j: Simplify logic expressions · 259f380e
      Mauro Carvalho Chehab 提交于
      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: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      259f380e
    • M
      [media] drx-j: don't use parenthesis on return · 64e49cb9
      Mauro Carvalho Chehab 提交于
      CodingStyle fix: don't use parenthesis on return, as it is not
      a function.
      Acked-by: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      64e49cb9
    • M
      [media] drx-j: replace the ugly CHK_ERROR() macro · 068e94ea
      Mauro Carvalho Chehab 提交于
      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: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      068e94ea
    • M
      [media] drx-j: Don't use buffer if an error occurs · b1d0a596
      Mauro Carvalho Chehab 提交于
      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: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      b1d0a596
    • M
      [media] drx-j: a few more CodingStyle fixups · adc0e258
      Mauro Carvalho Chehab 提交于
      Some whitespace cleanups.
      Acked-by: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      adc0e258
    • M
      [media] drx-j: Get rid of typedefs on drxh.h · b3ce3a83
      Mauro Carvalho Chehab 提交于
      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: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      b3ce3a83
    • M
      [media] drx-j: get rid of typedefs in drx_driver.h · 1bfc9e15
      Mauro Carvalho Chehab 提交于
      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: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      1bfc9e15
    • M
      [media] drx-j: Remove a bunch of unused but assigned vars · 4d7bb0eb
      Mauro Carvalho Chehab 提交于
      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: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      4d7bb0eb
    • M
      [media] drx-j: remove the unused tuner_i2c_write_read() function · c677f760
      Mauro Carvalho Chehab 提交于
      This function is not static. Also, it is not used anywhere.
      So, drop it.
      Acked-by: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      c677f760
    • M
      [media] drx-j: do more CodingStyle fixes · 22892268
      Mauro Carvalho Chehab 提交于
      This time, use checkpatch --strict --fix.
      Acked-by: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      22892268
    • M
      [media] drx-j: Don't use CamelCase · 57afe2f0
      Mauro Carvalho Chehab 提交于
      There's no reason at all to use CamelCase here. Convert all of
      them to normal case.
      Acked-by: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      57afe2f0
    • M
      [media] drx-j: Use checkpatch --fix to solve several issues · 7ef66759
      Mauro Carvalho Chehab 提交于
      Instead of manually fixing the issues, use the --fix experimental
      checkpatch. That solves a bunch of checkpatch issues.
      Acked-by: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      7ef66759
    • M
      [media] drx-j: fix whitespacing on pointer parmameters · dbe82e06
      Mauro Carvalho Chehab 提交于
      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: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      dbe82e06
    • M
      [media] drx-j: get rid of most of the typedefs · 61263c75
      Mauro Carvalho Chehab 提交于
      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: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      61263c75
    • M
      [media] drx-j: get rid of the other typedefs at bsp_types.h · 73f7065b
      Mauro Carvalho Chehab 提交于
      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: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      73f7065b
    • M
      [media] drx-j: get rid of the integer typedefs · 43a431e4
      Mauro Carvalho Chehab 提交于
      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: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      43a431e4
    • M
      [media] drx-j: remove the "const" annotate on HICommand() · bab3fcca
      Mauro Carvalho Chehab 提交于
      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: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      bab3fcca
    • M
      [media] drx-j: get rid of the typedefs on bsp_i2c.h · 5b223b39
      Mauro Carvalho Chehab 提交于
      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: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      5b223b39
    • M
      [media] drx-j: CodingStyle fixes · 443f18d0
      Mauro Carvalho Chehab 提交于
      Do the automatic CodingStyle fixes found at Lindent.
      
      No functional changes.
      Acked-by: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      443f18d0
    • D
      [media] drx-j: put under 3-clause BSD license · ca3355a9
      Devin Heitmueller 提交于
      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: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      ca3355a9
    • D
      [media] drx-j: add a driver for Trident drx-j frontend · 38b2df95
      Devin Heitmueller 提交于
      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: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      38b2df95