Mako: remove LGE KCAL, prepare for MSM KCAL
diff --git a/arch/arm/mach-msm/lge/Kconfig b/arch/arm/mach-msm/lge/Kconfig
index 30ce6bf..908c370 100644
--- a/arch/arm/mach-msm/lge/Kconfig
+++ b/arch/arm/mach-msm/lge/Kconfig
@@ -15,20 +15,6 @@
 	help
 	  LGE QFPROM DRIVER.
 
-config UPDATE_LCDC_LUT
-        bool "Set initial Qualcomm LCDC lut"
-        default n
-        depends on MACH_LGE
-        help
-         Set initial Qualcomm LCDC Look Up Table.
-
-config LCD_KCAL
-        bool "Interface to calibrate LCD color temperature"
-        default n
-        depends on MACH_LGE && UPDATE_LCDC_LUT
-        help
-         Interface to calibrate LCD color temperature
-
 config EARJACK_DEBUGGER
 	bool "Earjack UART debugger support"
 	depends on MACH_APQ8064_MAKO
diff --git a/arch/arm/mach-msm/lge/Makefile b/arch/arm/mach-msm/lge/Makefile
index 3fdfe74..d76cb08 100644
--- a/arch/arm/mach-msm/lge/Makefile
+++ b/arch/arm/mach-msm/lge/Makefile
@@ -4,8 +4,6 @@
 
 obj-$(CONFIG_MACH_LGE) += devices_lge.o 
 obj-$(CONFIG_LGE_QFPROM_INTERFACE) += lge_qfprom_access.o
-obj-$(CONFIG_UPDATE_LCDC_LUT) += lge_qc_lcdc_luts.o
-obj-$(CONFIG_LCD_KCAL) += lge_kcal_ctrl.o
 obj-$(CONFIG_LGE_CRASH_HANDLER) += lge_panic_handler.o
 
 CFLAGS_devices_lge.o += -Idrivers/staging/android
diff --git a/arch/arm/mach-msm/lge/devices_lge.c b/arch/arm/mach-msm/lge/devices_lge.c
index 504cc1e..2c96b9a 100644
--- a/arch/arm/mach-msm/lge/devices_lge.c
+++ b/arch/arm/mach-msm/lge/devices_lge.c
@@ -77,30 +77,6 @@
     return lge_bd_rev;
 }
 
-#ifdef CONFIG_LCD_KCAL
-extern int kcal_set_values(int kcal_r, int kcal_g, int kcal_b);
-static int __init display_kcal_setup(char *kcal)
-{
-	char vaild_k = 0;
-	int kcal_r = 0;
-	int kcal_g = 0;
-	int kcal_b = 0;
-
-	sscanf(kcal, "%d|%d|%d|%c", &kcal_r, &kcal_g, &kcal_b, &vaild_k );
-	pr_info("kcal is %d|%d|%d|%c\n", kcal_r, kcal_g, kcal_b, vaild_k);
-
-	if (vaild_k != 'K') {
-		pr_info("kcal not calibrated yet : %d\n", vaild_k);
-		kcal_r = kcal_g = kcal_b = 255;
-		pr_info("set to default : %d\n", kcal_r);
-	}
-
-	kcal_set_values(kcal_r, kcal_g, kcal_b);
-	return 1;
-}
-__setup("lge.kcal=", display_kcal_setup);
-#endif
-
 /* get boot mode information from cmdline.
  * If any boot mode is not specified,
  * boot mode is normal type.
diff --git a/arch/arm/mach-msm/lge/lge_kcal_ctrl.c b/arch/arm/mach-msm/lge/lge_kcal_ctrl.c
deleted file mode 100644
index a00ac7e..0000000
--- a/arch/arm/mach-msm/lge/lge_kcal_ctrl.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/* arch/arm/mach-msm/lge/lge_kcal_ctrl.c
- *
- * Interface to calibrate display color temperature.
- *
- * Copyright (C) 2012 LGE
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/device.h>
-#include <linux/platform_device.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <mach/board_lge.h>
-
-static struct kcal_platform_data *kcal_pdata;
-static int last_status_kcal_ctrl;
-
-static ssize_t kcal_store(struct device *dev, struct device_attribute *attr,
-						const char *buf, size_t count)
-{
-	int kcal_r = 0;
-	int kcal_g = 0;
-	int kcal_b = 0;
-
-	if (!count)
-		return -EINVAL;
-
-	sscanf(buf, "%d %d %d", &kcal_r, &kcal_g, &kcal_b);
-	kcal_pdata->set_values(kcal_r, kcal_g, kcal_b);
-	return count;
-}
-
-static ssize_t kcal_show(struct device *dev, struct device_attribute *attr,
-								char *buf)
-{
-	int kcal_r = 0;
-	int kcal_g = 0;
-	int kcal_b = 0;
-
-	kcal_pdata->get_values(&kcal_r, &kcal_g, &kcal_b);
-
-	return sprintf(buf, "%d %d %d\n", kcal_r, kcal_g, kcal_b);
-}
-
-static ssize_t kcal_ctrl_store(struct device *dev,
-		struct device_attribute *attr, const char *buf, size_t count)
-{
-	int cmd = 0;
-	if (!count)
-		return last_status_kcal_ctrl = -EINVAL;
-
-	sscanf(buf, "%d", &cmd);
-
-	if(cmd != 1)
-		return last_status_kcal_ctrl = -EINVAL;
-
-	last_status_kcal_ctrl = kcal_pdata->refresh_display();
-
-	if(last_status_kcal_ctrl)
-		return -EINVAL;
-	else
-		return count;
-}
-
-static ssize_t kcal_ctrl_show(struct device *dev,
-				struct device_attribute *attr, char *buf)
-{
-	if(last_status_kcal_ctrl)
-		return sprintf(buf, "NG\n");
-	else
-		return sprintf(buf, "OK\n");
-}
-
-static DEVICE_ATTR(kcal, 0644, kcal_show, kcal_store);
-static DEVICE_ATTR(kcal_ctrl, 0644, kcal_ctrl_show, kcal_ctrl_store);
-
-static int kcal_ctrl_probe(struct platform_device *pdev)
-{
-	int rc = 0;
-	kcal_pdata = pdev->dev.platform_data;
-
-	if(!kcal_pdata->set_values || !kcal_pdata->get_values ||
-					!kcal_pdata->refresh_display) {
-		printk(KERN_ERR "kcal function not registered\n");
-		return -1;
-	}
-
-	rc = device_create_file(&pdev->dev, &dev_attr_kcal);
-	if(rc !=0)
-		return -1;
-	rc = device_create_file(&pdev->dev, &dev_attr_kcal_ctrl);
-	if(rc !=0)
-		return -1;
-
-	return 0;
-}
-static struct platform_driver this_driver = {
-	.probe  = kcal_ctrl_probe,
-	.driver = {
-		.name   = "kcal_ctrl",
-	},
-};
-
-int __init kcal_ctrl_init(void)
-{
-	printk(KERN_INFO "kcal_ctrl_init \n");
-	return platform_driver_register(&this_driver);
-}
-
-device_initcall(kcal_ctrl_init);
-
-MODULE_DESCRIPTION("LGE KCAL driver");
-MODULE_LICENSE("GPL v2");
diff --git a/arch/arm/mach-msm/lge/lge_qc_lcdc_luts.c b/arch/arm/mach-msm/lge/lge_qc_lcdc_luts.c
deleted file mode 100644
index 807a4f9..0000000
--- a/arch/arm/mach-msm/lge/lge_qc_lcdc_luts.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/* arch/arm/mach-msm/lge/lge_qc_lcdc_luts.c
- * Copyright (c) 2011, LG Electronics. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <linux/module.h>
-
-/* pixel order : RBG */
-const unsigned int lcd_color_preset_lut[256] = {
-	/* default linear qlut */
-	0x00000000, 0x00010101, 0x00020202, 0x00030303,
-	0x00040404, 0x00050505, 0x00060606, 0x00070707,
-	0x00080808, 0x00090909, 0x000a0a0a, 0x000b0b0b,
-	0x000c0c0c, 0x000d0d0d, 0x000e0e0e, 0x000f0f0f,
-	0x00101010, 0x00111111, 0x00121212, 0x00131313,
-	0x00141414, 0x00151515, 0x00161616, 0x00171717,
-	0x00181818, 0x00191919, 0x001a1a1a, 0x001b1b1b,
-	0x001c1c1c, 0x001d1d1d, 0x001e1e1e, 0x001f1f1f,
-	0x00202020, 0x00212121, 0x00222222, 0x00232323,
-	0x00242424, 0x00252525, 0x00262626, 0x00272727,
-	0x00282828, 0x00292929, 0x002a2a2a, 0x002b2b2b,
-	0x002c2c2c, 0x002d2d2d, 0x002e2e2e, 0x002f2f2f,
-	0x00303030, 0x00313131, 0x00323232, 0x00333333,
-	0x00343434, 0x00353535, 0x00363636, 0x00373737,
-	0x00383838, 0x00393939, 0x003a3a3a, 0x003b3b3b,
-	0x003c3c3c, 0x003d3d3d, 0x003e3e3e, 0x003f3f3f,
-	0x00404040, 0x00414141, 0x00424242, 0x00434343,
-	0x00444444, 0x00454545, 0x00464646, 0x00474747,
-	0x00484848, 0x00494949, 0x004a4a4a, 0x004b4b4b,
-	0x004c4c4c, 0x004d4d4d, 0x004e4e4e, 0x004f4f4f,
-	0x00505050, 0x00515151, 0x00525252, 0x00535353,
-	0x00545454, 0x00555555, 0x00565656, 0x00575757,
-	0x00585858, 0x00595959, 0x005a5a5a, 0x005b5b5b,
-	0x005c5c5c, 0x005d5d5d, 0x005e5e5e, 0x005f5f5f,
-	0x00606060, 0x00616161, 0x00626262, 0x00636363,
-	0x00646464, 0x00656565, 0x00666666, 0x00676767,
-	0x00686868, 0x00696969, 0x006a6a6a, 0x006b6b6b,
-	0x006c6c6c, 0x006d6d6d, 0x006e6e6e, 0x006f6f6f,
-	0x00707070, 0x00717171, 0x00727272, 0x00737373,
-	0x00747474, 0x00757575, 0x00767676, 0x00777777,
-	0x00787878, 0x00797979, 0x007a7a7a, 0x007b7b7b,
-	0x007c7c7c, 0x007d7d7d, 0x007e7e7e, 0x007f7f7f,
-	0x00808080, 0x00818181, 0x00828282, 0x00838383,
-	0x00848484, 0x00858585, 0x00868686, 0x00878787,
-	0x00888888, 0x00898989, 0x008a8a8a, 0x008b8b8b,
-	0x008c8c8c, 0x008d8d8d, 0x008e8e8e, 0x008f8f8f,
-	0x00909090, 0x00919191, 0x00929292, 0x00939393,
-	0x00949494, 0x00959595, 0x00969696, 0x00979797,
-	0x00989898, 0x00999999, 0x009a9a9a, 0x009b9b9b,
-	0x009c9c9c, 0x009d9d9d, 0x009e9e9e, 0x009f9f9f,
-	0x00a0a0a0, 0x00a1a1a1, 0x00a2a2a2, 0x00a3a3a3,
-	0x00a4a4a4, 0x00a5a5a5, 0x00a6a6a6, 0x00a7a7a7,
-	0x00a8a8a8, 0x00a9a9a9, 0x00aaaaaa, 0x00ababab,
-	0x00acacac, 0x00adadad, 0x00aeaeae, 0x00afafaf,
-	0x00b0b0b0, 0x00b1b1b1, 0x00b2b2b2, 0x00b3b3b3,
-	0x00b4b4b4, 0x00b5b5b5, 0x00b6b6b6, 0x00b7b7b7,
-	0x00b8b8b8, 0x00b9b9b9, 0x00bababa, 0x00bbbbbb,
-	0x00bcbcbc, 0x00bdbdbd, 0x00bebebe, 0x00bfbfbf,
-	0x00c0c0c0, 0x00c1c1c1, 0x00c2c2c2, 0x00c3c3c3,
-	0x00c4c4c4, 0x00c5c5c5, 0x00c6c6c6, 0x00c7c7c7,
-	0x00c8c8c8, 0x00c9c9c9, 0x00cacaca, 0x00cbcbcb,
-	0x00cccccc, 0x00cdcdcd, 0x00cecece, 0x00cfcfcf,
-	0x00d0d0d0, 0x00d1d1d1, 0x00d2d2d2, 0x00d3d3d3,
-	0x00d4d4d4, 0x00d5d5d5, 0x00d6d6d6, 0x00d7d7d7,
-	0x00d8d8d8, 0x00d9d9d9, 0x00dadada, 0x00dbdbdb,
-	0x00dcdcdc, 0x00dddddd, 0x00dedede, 0x00dfdfdf,
-	0x00e0e0e0, 0x00e1e1e1, 0x00e2e2e2, 0x00e3e3e3,
-	0x00e4e4e4, 0x00e5e5e5, 0x00e6e6e6, 0x00e7e7e7,
-	0x00e8e8e8, 0x00e9e9e9, 0x00eaeaea, 0x00ebebeb,
-	0x00ececec, 0x00ededed, 0x00eeeeee, 0x00efefef,
-	0x00f0f0f0, 0x00f1f1f1, 0x00f2f2f2, 0x00f3f3f3,
-	0x00f4f4f4, 0x00f5f5f5, 0x00f6f6f6, 0x00f7f7f7,
-	0x00f8f8f8, 0x00f9f9f9, 0x00fafafa, 0x00fbfbfb,
-	0x00fcfcfc, 0x00fdfdfd, 0x00fefefe, 0x00ffffff
-};
-EXPORT_SYMBOL(lcd_color_preset_lut);
diff --git a/arch/arm/mach-msm/lge/mako/board-mako-display.c b/arch/arm/mach-msm/lge/mako/board-mako-display.c
index 08f0069..d5016ab 100644
--- a/arch/arm/mach-msm/lge/mako/board-mako-display.c
+++ b/arch/arm/mach-msm/lge/mako/board-mako-display.c
@@ -102,36 +102,10 @@
 	return 0;
 }
 
-#ifdef CONFIG_LCD_KCAL
-struct kcal_data kcal_value;
-#endif
-
 #ifdef CONFIG_UPDATE_LCDC_LUT
-extern unsigned int lcd_color_preset_lut[];
 int update_preset_lcdc_lut(void)
 {
-	struct fb_cmap cmap;
-	int ret = 0;
-
-	cmap.start = 0;
-	cmap.len = 256;
-	cmap.transp = NULL;
-
-#ifdef CONFIG_LCD_KCAL
-	cmap.red = (uint16_t *)&(kcal_value.red);
-	cmap.green = (uint16_t *)&(kcal_value.green);
-	cmap.blue = (uint16_t *)&(kcal_value.blue);
-#else
-	cmap.red = NULL;
-	cmap.green = NULL;
-	cmap.blue = NULL;
-#endif
-
-	ret = mdp_preset_lut_update_lcdc(&cmap, lcd_color_preset_lut);
-	if (ret)
-		pr_err("%s: failed to set lut! %d\n", __func__, ret);
-
-	return ret;
+	return 0;
 }
 #endif
 
@@ -274,42 +248,6 @@
 #endif
 }
 
-#ifdef CONFIG_LCD_KCAL
-int kcal_set_values(int kcal_r, int kcal_g, int kcal_b)
-{
-	kcal_value.red = kcal_r;
-	kcal_value.green = kcal_g;
-	kcal_value.blue = kcal_b;
-	return 0;
-}
-
-static int kcal_get_values(int *kcal_r, int *kcal_g, int *kcal_b)
-{
-	*kcal_r = kcal_value.red;
-	*kcal_g = kcal_value.green;
-	*kcal_b = kcal_value.blue;
-	return 0;
-}
-
-static int kcal_refresh_values(void)
-{
-	return update_preset_lcdc_lut();
-}
-
-static struct kcal_platform_data kcal_pdata = {
-	.set_values = kcal_set_values,
-	.get_values = kcal_get_values,
-	.refresh_display = kcal_refresh_values
-};
-
-static struct platform_device kcal_platrom_device = {
-	.name   = "kcal_ctrl",
-	.dev = {
-		.platform_data = &kcal_pdata,
-	}
-};
-#endif
-
 static struct resource hdmi_msm_resources[] = {
 	{
 		.name  = "hdmi_msm_qfprom_addr",
@@ -917,9 +855,6 @@
 #if defined(CONFIG_FB_MSM_MIPI_LGIT_VIDEO_WXGA_PT)
 	&mipi_dsi_lgit_panel_device,
 #endif
-#ifdef CONFIG_LCD_KCAL
-	&kcal_platrom_device,
-#endif
 };
 
 void __init apq8064_init_fb(void)