[Nexus 4 Original Android Development] _motley:
cocchiararo, check your script you linked on this post and either correct or remove. If you got it from other source, you should let them know as well. Some of the sysfs names are messed up. Not sure if there are more issues that I didn't catch, but only the blue will be set resulting in something very weird.

Errors I see are in red

#!/system/bin/sh
# molesarecoming's "halfbreed2" settings
#Setting rgb
color_r=255
color_g=255
color_b=255
echo "$color_r $color_g $color_b" > /sys/devices/platform/kcal_ctrl.0/kcal
echo 1 > /sys/devices/platform/kcal_ctrl.0/kcal_ctrl

#Setting gamma
#define g_white 0x40
#define g_mids 0x44
#define g_black 0x76
#define g_contrast 0x19
#define g_brightness 0x04
#define g_saturation 0x42
#define g_greys 0x20
g_white=64 #Whitepoint, LG=0x72, GOOG=0x40,40,20 Low values=extreme whites, risk of blown out highlights
g_mids=68
g_black=118 #Blackpoint, LG=0x76, GOOG=0x76,76,74 Low values=cut out, banding in the shadows
g_unknown1=0
g_contrast=25 #Contrast, LG=0x00, GOOG=0x00,00,1F
g_brightness=4 #Brightness, LG=0x00, GOOG=0x00,00,10
g_saturation=66 #Saturation, LG=0x50, GOOG=0x30,30,50
g_greys=32
g_unknown2=1

#Tweak red gamma values here if needed
gr_white=`expr $g_white + 0`
gr_mids=`expr $g_mids + 0`
gr_black=`expr $g_black + 0`
gr_unknown1=`expr $g_unknown1 + 0`
gr_contrast=`expr $g_contrast + 0`
gr_brightness=`expr $g_brightness + 0`
gr_saturation=`expr $g_saturation + 0`
gr_greys=`expr $g_greys + 0`
gr_unknown2=`expr $g_unknown2 + 0`
gr_cksummotley=`expr $gr_white + $gr_mids + $gr_black + $gr_unknown1 + $gr_contrast + $gr_brightness + $gr_saturation + $gr_greys + $gr_unknown2`

#Tweak green gamma values here if needed
gg_white=`expr $g_white + 0`
gg_mids=`expr $g_mids + 0`
gg_black=`expr $g_black + 0`
gg_unknown1=`expr $g_unknown1 + 0`
gg_contrast=`expr $g_contrast + 0`
gg_brightness=`expr $g_brightness + 0`
gg_saturation=`expr $g_saturation + 0`
gg_greys=`expr $g_greys + 0`
gg_unknown2=`expr $g_unknown2 + 0`
gg_cksummotley=`expr $gg_white + $gg_mids + $gg_black + $gg_unknown1 + $gg_contrast + $gg_brightness + $gg_saturation + $gg_greys + $gg_unknown2`

#Tweak blue gamma values here if needed
gb_white=`expr $g_white + 0`
gb_mids=`expr $g_mids + 0`
gb_black=`expr $g_black + 0`
gb_unknown1=`expr $g_unknown1 + 0`
gb_contrast=`expr $g_contrast + 0`
gb_brightness=`expr $g_brightness + 0`
gb_saturation=`expr $g_saturation + 0`
gb_greys=`expr $g_greys + 0`
gb_unknown2=`expr $g_unknown2 + 0`
gb_cksummotley=`expr $gb_white + $gb_mids + $gb_black + $gb_unknown1 + $gb_contrast + $gb_brightness + $gb_saturation + $gb_greys + $gb_unknown2`

echo "$gr_cksummotley $gr_white $gr_mids $gr_black $gr_unknown1 $gr_contrast $gr_brightness $gr_saturation $gr_greys $gr_unknown2" > /sys/devices/platform/mipi_lgit.1537/[COLOR="red"]kgamma_reded[/COLOR]
echo "$gg_cksummotley $gg_white $gg_mids $gg_black $gg_unknown1 $gg_contrast $gg_brightness $gg_saturation $gg_greys $gg_unknown2" > /sys/devices/platform/mipi_lgit.1537/[COLOR="red"]kgamma_greenreen[/COLOR]
echo "$gb_cksummotley $gb_white $gb_mids $gb_black $gb_unknown1 $gb_contrast $gb_brightness $gb_saturation $gb_greys $gb_unknown2" > /sys/devices/platform/mipi_lgit.1537/kgamma_blue

# Show the current configuration and the checksum
echo "Verify that the values are written correctly..\n"
echo "RGB values:"
cat /sys/devices/platform/kcal_ctrl.0/kcal
echo "\nRed gamma values:"
cat /sys/devices/platform/mipi_lgit.1537/[COLOR="Red"]kgamma_reded[/COLOR]
echo "\nGreen gamma values:"
cat /sys/devices/platform/mipi_lgit.1537/[COLOR="Red"]kgamma_greenreen[/COLOR]
echo "\nBlue gamma values:"
cat /sys/devices/platform/mipi_lgit.1537/kgamma_blue
echo ""

#values tweaked by molesarecoming (Paranoid Android)
#script by jazzboyrulescript by jazzboyrules

Anything we can dream up will be able to work through the sysfs interface. If the values are given in hex, they just need to be converted properly. Hope you feel better soon!

-----

Just thinking out loud if other kernel devs are listening...since the arrays in the kernel are using the "char" datatype there is no reason why us kernel devs can't just enter the values into the array in the kernel source code as decimal values instead of hex. Once the number is stored into the array it is binary as far as the compiler is concerned and the hex and decimal are just different ways representing the same binary value. If we would all do this, it would make it easier for everyone to translate and share settings whether hard-coded or not. I'm sure more folks than I are tired of converting back and forth:eek:

Also, just a friendly note to all...please make sure you test scripts before posting here to make sure they do what they are supposed to.

Thx!