summaryrefslogtreecommitdiff
path: root/v4l/scripts
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-06-17 08:45:59 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-17 08:45:59 -0300
commitf3557e8748785f4d92bcfad80becf953561bb2e7 (patch)
treebafd307fb6c4a1de0293294ddc91fdd74ef23b15 /v4l/scripts
parent176e978976d45583b0a9a79dda25de21c1d47e01 (diff)
downloadmediapointer-dvb-s2-f3557e8748785f4d92bcfad80becf953561bb2e7.tar.gz
mediapointer-dvb-s2-f3557e8748785f4d92bcfad80becf953561bb2e7.tar.bz2
Hex handling is different from int
From: Mauro Carvalho Chehab <mchehab@infradead.org> Kernel handling of hex type passes those values prefixed with 0x to the modules. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l/scripts')
-rwxr-xr-xv4l/scripts/make_kconfig.pl33
1 files changed, 29 insertions, 4 deletions
diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl
index 228e0aa48..4511f0def 100755
--- a/v4l/scripts/make_kconfig.pl
+++ b/v4l/scripts/make_kconfig.pl
@@ -5,6 +5,7 @@ my %depend = ();
my %minver = ();
my %config = ();
my %intopt = ();
+my %hexopt = ();
my %tristate = ();
my $version, $level, $sublevel;
@@ -32,19 +33,36 @@ sub add_int($)
{
my $arg=shift;
- exists $config{$arg} or die "Adding unknown int/hex '$arg'";
+ exists $config{$arg} or die "Adding unknown int '$arg'";
$intopt{$arg} = 0;
}
+sub add_hex($)
+{
+ my $arg=shift;
+
+ exists $config{$arg} or die "Adding unknown hex '$arg'";
+ $hexopt{$arg} = 0;
+}
+
sub set_int_value($$)
{
my $key = shift;
my $val = shift;
- exists $intopt{$key} or die "Default for unknown int/hex option '$key'";
+ exists $intopt{$key} or die "Default for unknown int option '$key'";
$intopt{$key} = $val;
}
+sub set_hex_value($$)
+{
+ my $key = shift;
+ my $val = shift;
+
+ exists $hexopt{$key} or die "Default for unknown hex option '$key'";
+ $hexopt{$key} = "0x".$val;
+}
+
sub add_config($)
{
my $arg=shift;
@@ -121,12 +139,16 @@ sub open_kconfig($$) {
add_int($key);
}
if (m|^\s+hex\s|) {
- add_int($key);
+ add_hex($key);
}
# Get default for int options
- if (m|^\s+default "([[:xdigit:]]+)"| && exists $intopt{$key}) {
+ if (m|^\s+default "(\d+)"| && exists $intopt{$key}) {
set_int_value($key, $1);
}
+ # Get default for hex options
+ if (m|^\s+default "([[:xdigit:]]+)"| && exists $hexopt{$key}) {
+ set_hex_value($key, $1);
+ }
# Override default for disabled tri/bool options
if (m/^\s+default (y|n|m|"yes"|"no")\s+(if .*)?$/ &&
exists $tristate{$key} && $disabled) {
@@ -281,5 +303,8 @@ if (($force_kconfig eq 1) || !open IN,".config") {
while ( my ($key,$value) = each(%intopt) ) {
print OUT "CONFIG_$key=$value\n";
}
+ while ( my ($key,$value) = each(%hexopt) ) {
+ print OUT "CONFIG_$key=$value\n";
+ }
close OUT;
}