• Mauro Carvalho Chehab's avatar
    V4L/DVB (9758): em28xx: replace some magic by register descriptions where known · 2a29a0d7
    Mauro Carvalho Chehab authored
    Replaces all occurrences of em28xx_write_regs_req() and em28xx_write_reg()
    used to setup register names by em28xx_write_reg().
    
    Also, documents the register names that are known.
    
    This patch were generated by this small perl script:
    
    my %reg_map = (
    	# Register table - the same as defined on parse_em28xx.pl script
    );
    
    while (<>) {
    	if (m/(.*)em28xx_write_regs_req\(dev\,\s*0x00\,\s*(.*)\,\s*\"\\x(..)\",\s*1\)\;(.*)/) {
    		my $reg = $2;
    		my $val = $3;
    		$val =~ tr/A-f/a-f/;
    		$reg = $reg_map{$reg} if defined($reg_map{$reg});
    		printf "$1em28xx_write_reg(dev, %s, 0x%s);$4\n", $reg, $val;
    	} elsif (m/(.*)em28xx_write_regs\(dev\,\s*(.*)\,\s*\"\\x(..)\",\s*1\)\;(.*)/) {
    		my $reg = $2;
    		my $val = $3;
    		$val =~ tr/A-f/a-f/;
    		$reg = $reg_map{$reg} if defined($reg_map{$reg});
    		printf "$1em28xx_write_reg(dev, %s, 0x%s);$4\n", $reg, $val;
    	} else {
    		print $_;
    	}
    }
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
    2a29a0d7
em28xx-video.c 57.6 KB