common: display: Update parser with strings in dtsi

In kernel, dtsi is now using strings for several
properties instead of u32 datatypes. Updating
the parser to account for this change.

Change-Id: I9f8236201658a5c857fe9301b4b10cc248751021
This commit is contained in:
Casey Piper 2014-02-20 14:04:24 -08:00
parent 8a9e60cc51
commit 96d910aa44
1 changed files with 256 additions and 4 deletions

View File

@ -143,6 +143,16 @@ if(uc($ARGV[1]) eq "PANEL")
printArray($PANELDTSI, \@tmp, $property, printArray($PANELDTSI, \@tmp, $property,
"qcom,mdss-dsi-panel-framerate"); "qcom,mdss-dsi-panel-framerate");
} }
elsif($_ eq "PixelPacking")
{
printPixelPacking($PANELDTSI, \@tmp, $property,
"qcom,mdss-dsi-pixel-packing");
}
elsif($_ eq "ColorOrder")
{
printColorOrder($PANELDTSI, \@tmp, $property,
"qcom,mdss-dsi-color-order");
}
else else
{ {
printArray($PANELDTSI, \@tmp, $property, printArray($PANELDTSI, \@tmp, $property,
@ -228,8 +238,7 @@ if(uc($ARGV[1]) eq "PANEL")
"qcom,mdss-dsi-" . $lower); "qcom,mdss-dsi-" . $lower);
} }
my @attrs = ("HSyncPulse", "TrafficMode", my @attrs = ("HSyncPulse",);
"DSILaneMap",);
foreach(@attrs) foreach(@attrs)
{ {
@ -241,6 +250,22 @@ if(uc($ARGV[1]) eq "PANEL")
"qcom,mdss-dsi-" . $lower); "qcom,mdss-dsi-" . $lower);
} }
@attrs = ("TrafficMode",);
foreach(@attrs)
{
push(my @tmp, $_);
printTrafficMode($PANELDTSI, \@tmp, $property,
"qcom,mdss-dsi-traffic-mode");
}
@attrs = ("DSILaneMap",);
foreach(@attrs)
{
push(my @tmp, $_);
printLaneMap($PANELDTSI, \@tmp, $property,
"qcom,mdss-dsi-lane-map");
}
@attrs = ("BLLPEOFPowerMode"); @attrs = ("BLLPEOFPowerMode");
foreach(@attrs) foreach(@attrs)
{ {
@ -479,14 +504,14 @@ if(uc($ARGV[1]) eq "PANEL")
foreach(@attrs) foreach(@attrs)
{ {
push(my @tmp, $_); push(my @tmp, $_);
printArray($PANELDTSI, \@tmp, $property, printTrigger($PANELDTSI, \@tmp, $property,
"qcom,mdss-dsi-dma-trigger"); "qcom,mdss-dsi-dma-trigger");
} }
@attrs = ("DSIMDPTrigger"); @attrs = ("DSIMDPTrigger");
foreach(@attrs) foreach(@attrs)
{ {
push(my @tmp, $_); push(my @tmp, $_);
printArray($PANELDTSI, \@tmp, $property, printTrigger($PANELDTSI, \@tmp, $property,
"qcom,mdss-dsi-mdp-trigger"); "qcom,mdss-dsi-mdp-trigger");
} }
@ -596,6 +621,22 @@ elsif(uc($ARGV[1]) eq "PLATFORM")
printGPIO($PLATFORMDTSI, $property, "qcom,platform-te-gpio"); printGPIO($PLATFORMDTSI, $property, "qcom,platform-te-gpio");
} }
for my $property ($xmldoc->findnodes('/GCDB/PlatformEntry/ModeGPIO'))
{
printStruct($PLATFORMH, \@gpioConfAttrs, $property, "gpio_pin",
"mode_gpio");
print $PLATFORMH "\n\n";
printGPIO($PLATFORMDTSI, $property, "qcom,platform-mode-gpio");
}
for my $property ($xmldoc->findnodes('/GCDB/PlatformEntry/BacklightGPIO'))
{
printStruct($PLATFORMH, \@gpioConfAttrs, $property,
"gpio_pin", "bklight_gpio");
print $PLATFORMH "\n\n";
printGPIO($PLATFORMDTSI, $property, "qcom,platform-bklight-gpio");
}
for my $property ($xmldoc->findnodes('/GCDB/PlatformEntry/PWMGPIO')) for my $property ($xmldoc->findnodes('/GCDB/PlatformEntry/PWMGPIO'))
{ {
printStruct($PLATFORMH, \@gpioConfAttrs, $property, "gpio_pin", printStruct($PLATFORMH, \@gpioConfAttrs, $property, "gpio_pin",
@ -1114,6 +1155,217 @@ sub printCommandState
} }
} }
sub printTrigger
{
my $fh = shift;
my $attrs = shift;
my @attrs = @$attrs;
my $property = shift;
my $name = shift;
my $first = 1;
foreach(@attrs)
{
for my $element ($property->findnodes("./" . $_))
{
print $fh "\t\t" . $name . " = \"";
my $str = $element->textContent();
if ($str =~ /0x0.$/) {
$str =~ s/0x0//;
}
$str =~ s/0x//;
if($str eq "0")
{
print $fh "none";
}
elsif($str eq "2")
{
print $fh "trigger_te";
}
elsif($str eq "4")
{
print $fh "trigger_sw";
}
elsif($str eq "5")
{
print $fh "trigger_sw_seof";
}
elsif($str eq "6")
{
print $fh "trigger_sw_te";
}
print $fh "\";\n";
}
}
}
sub printPixelPacking
{
my $fh = shift;
my $attrs = shift;
my @attrs = @$attrs;
my $property = shift;
my $name = shift;
my $first = 1;
foreach(@attrs)
{
for my $element ($property->findnodes("./" . $_))
{
my $str = $element->textContent();
if ($str =~ /0x0.$/) {
$str =~ s/0x0//;
}
$str =~ s/0x//;
print $fh "\t\t" . $name . " = \"";
if($str eq "1")
{
print $fh "loose";
}
elsif($str eq "0")
{
print $fh "tight";
}
print $fh "\";\n";
}
}
}
sub printTrafficMode
{
my $fh = shift;
my $attrs = shift;
my @attrs = @$attrs;
my $property = shift;
my $name = shift;
my $first = 1;
foreach(@attrs)
{
for my $element ($property->findnodes("./" . $_))
{
print $fh "\t\t" . $name . " = \"";
my $str = $element->textContent();
if ($str =~ /0x0.$/) {
$str =~ s/0x0//;
}
$str =~ s/0x//;
if($str eq "0")
{
print $fh "non_burst_sync_pulse";
}
elsif($str eq "1")
{
print $fh "non_burst_sync_event";
}
elsif($str eq "2")
{
print $fh "burst_mode";
}
print $fh "\";\n";
}
}
}
sub printColorOrder
{
my $fh = shift;
my $attrs = shift;
my @attrs = @$attrs;
my $property = shift;
my $name = shift;
my $first = 1;
foreach(@attrs)
{
for my $element ($property->findnodes("./" . $_))
{
print $fh "\t\t" . $name . " = \"";
my $str = $element->textContent();
if ($str =~ /0x0.$/) {
$str =~ s/0x0//;
}
$str =~ s/0x//;
if($str eq "0")
{
print $fh "rgb_swap_rgb";
}
elsif($str eq "1")
{
print $fh "rgb_swap_rbg";
}
elsif($str eq "2")
{
print $fh "rgb_swap_bgr";
}
elsif($str eq "3")
{
print $fh "rgb_swap_brg";
}
elsif($str eq "4")
{
print $fh "rgb_swap_grb";
}
elsif($str eq "5")
{
print $fh "rgb_swap_gbr";
}
print $fh "\";\n";
}
}
}
sub printLaneMap
{
my $fh = shift;
my $attrs = shift;
my @attrs = @$attrs;
my $property = shift;
my $name = shift;
my $first = 1;
foreach(@attrs)
{
for my $element ($property->findnodes("./" . $_))
{
print $fh "\t\t" . $name . " = \"";
my $str = $element->textContent();
if ($str =~ /0x0.$/) {
$str =~ s/0x0//;
}
$str =~ s/0x//;
if($str eq "0")
{
print $fh "lane_map_0123";
}
elsif($str eq "1")
{
print $fh "lane_map_3012";
}
elsif($str eq "2")
{
print $fh "lane_map_2301";
}
elsif($str eq "3")
{
print $fh "lane_map_1230";
}
elsif($str eq "4")
{
print $fh "lane_map_0321";
}
elsif($str eq "5")
{
print $fh "lane_map_1032";
}
elsif($str eq "6")
{
print $fh "lane_map_2103";
}
elsif($str eq "7")
{
print $fh "lane_map_3210";
}
print $fh "\";\n";
}
}
}
sub printPanelType sub printPanelType
{ {
my $fh = shift; my $fh = shift;