summaryrefslogtreecommitdiff
path: root/v4l/scripts
diff options
context:
space:
mode:
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;
}