Skip to content
Browse files

alessi: Get rid of LGE_UNIFIED_LED

The default msm-pmic stuff does the same, no need for the custom
hooks
  • Loading branch information...
1 parent 48d7434 commit cd15148cb40323c2ed8b0e7c84d007193776447c @rmcc rmcc committed Jun 18, 2012
Showing with 4 additions and 181 deletions.
  1. +3 −8 arch/arm/configs/cyanogenmod_alessi_defconfig
  2. +1 −173 arch/arm/mach-msm/lge/board-alessi-misc.c
View
11 arch/arm/configs/cyanogenmod_alessi_defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.35.10
-# Sat May 5 23:44:41 2012
+# Mon Jun 18 00:47:33 2012
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -286,7 +286,7 @@ CONFIG_LGE_HEADSET_ADC=y
CONFIG_LGE_SWITCH_GPIO=y
CONFIG_LGE_PROC_COMM=y
CONFIG_LGE_FUEL_GAUGE=y
-CONFIG_LGE_UNIFIED_LED=y
+# CONFIG_LGE_UNIFIED_LED is not set
CONFIG_LGE_4G_DDR=y
CONFIG_LGE_SUPPORT_AT_CMD=y
# CONFIG_LGE_ATS_UEVENT_DEVICE is not set
@@ -1683,12 +1683,7 @@ CONFIG_BACKLIGHT_AAT2870=y
#
# CONFIG_VGA_CONSOLE is not set
CONFIG_DUMMY_CONSOLE=y
-CONFIG_FRAMEBUFFER_CONSOLE=y
-# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
-# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
-# CONFIG_FONTS is not set
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
+# CONFIG_FRAMEBUFFER_CONSOLE is not set
# CONFIG_LOGO is not set
CONFIG_SOUND=y
# CONFIG_SOUND_OSS_CORE is not set
View
174 arch/arm/mach-msm/lge/board-alessi-misc.c
@@ -75,182 +75,10 @@ static struct platform_device msm_batt_device = {
#define REG_WRITEL(value, reg) writel(value, (MSM_WEB_BASE+reg))
-/*LED has 15 steps (10mA per step). LED's max power capacity is 150mA. (0~255 level)*/
-#define MAX_BACKLIGHT_LEVEL 16 // 150mA
-#define TUNED_MAX_BACKLIGHT_LEVEL 40 // 60mA
-
-/*LED has 15 steps (10mA per step). LED's max power capacity is 150mA. (0~255 level)*/
-#define MAX_BACKLIGHT_LEVEL 16 // 150mA
-#define TUNED_MAX_BACKLIGHT_LEVEL 40 // 60mA
-
-
-static void button_bl_leds_set(struct led_classdev *led_cdev,
- enum led_brightness value)
-{
- int ret;
-
- ret = pmic_set_led_intensity(LED_KEYPAD, value / TUNED_MAX_BACKLIGHT_LEVEL);
-
- if (ret)
- dev_err(led_cdev->dev, "can't set keypad backlight\n");
-
-}
-
-struct led_classdev thunderg_custom_leds[] = {
- {
- .name = "button-backlight",
- .brightness_set = button_bl_leds_set,
- .brightness = LED_OFF,
- },
-};
-
-static int register_leds(struct platform_device *pdev)
-{
- int rc;
- rc = led_classdev_register(&pdev->dev, &thunderg_custom_leds);
- if (rc) {
- dev_err(&pdev->dev, "unable to register led class driver\n");
- return rc;
- }
- button_bl_leds_set(&thunderg_custom_leds, LED_OFF);
- return rc;
-}
-
-static int unregister_leds(struct platform_device *pdev)
-{
- //led_classdev_unregister(&thunderg_custom_leds);
- button_bl_leds_set(&thunderg_custom_leds, LED_OFF);
- return 0;
-}
-
-static int suspend_leds(struct platform_device *dev,
- pm_message_t state)
-{
- //led_classdev_suspend(&thunderg_custom_leds);
-
- return 0;
-}
-
-static int resume_leds(struct platform_device *dev)
-{
- led_classdev_resume(&thunderg_custom_leds);
-
- return 0;
-}
-
-static struct msm_pmic_leds_pdata leds_pdata = {
- .custom_leds = thunderg_custom_leds,
- .register_custom_leds = register_leds,
- .unregister_custom_leds = unregister_leds,
- .suspend_custom_leds = suspend_leds,
- .resume_custom_leds = resume_leds,
- .msm_keypad_led_set = button_bl_leds_set,
-};
-
static struct platform_device msm_device_pmic_leds = {
.name = "pmic-leds",
.id = -1,
- .dev.platform_data = &leds_pdata,
-};
-/* lge carkit device */
-static char *dock_state_string[] = {
- "0",
- "1",
- "2",
-};
-
-enum {
- DOCK_STATE_UNDOCKED = 0,
- DOCK_STATE_DESK = 1, /* multikit */
- DOCK_STATE_CAR = 2, /* carkit */
- DOCK_STATE_UNKNOWN,
-};
-
-enum {
- KIT_DOCKED = 0,
- KIT_UNDOCKED = 1,
-};
-
-static void alessi_desk_dock_detect_callback(int state)
-{
- int ret;
-
- if (state)
- state = DOCK_STATE_DESK;
-
- ret = lge_gpio_switch_pass_event("dock", state);
-
- if (ret)
- printk(KERN_INFO "%s: desk dock event report fail\n", __func__);
-
- return;
-}
-
-static void alessi_register_callback(void)
-{
- rpc_server_hs_register_callback(alessi_desk_dock_detect_callback);
-
- return;
-}
-static int alessi_gpio_carkit_work_func(void)
-{
- int state;
- int gpio_value;
-
- gpio_value = gpio_get_value(GPIO_CARKIT_DETECT);
- printk(KERN_INFO"%s: carkit detected : %s\n", __func__,
- gpio_value?"undocked":"docked");
- if (gpio_value == KIT_DOCKED)
- state = DOCK_STATE_CAR;
- else
- state = DOCK_STATE_UNDOCKED;
-
- return state;
-}
-
-static char *alessi_gpio_carkit_print_state(int state)
-{
- return dock_state_string[state];
-}
-
-static int alessi_gpio_carkit_sysfs_store(const char *buf, size_t size)
-{
- int state;
-
- if (!strncmp(buf, "undock", size-1))
- state = DOCK_STATE_UNDOCKED;
- else if (!strncmp(buf, "desk", size-1))
- state = DOCK_STATE_DESK;
- else if (!strncmp(buf, "car", size-1))
- state = DOCK_STATE_CAR;
- else
- return -EINVAL;
-
- return state;
-}
-
-static unsigned alessi_carkit_gpios[] = {
- GPIO_CARKIT_DETECT,
-};
-
-static struct lge_gpio_switch_platform_data alessi_carkit_data = {
- .name = "dock",
- .gpios = alessi_carkit_gpios,
- .num_gpios = ARRAY_SIZE(alessi_carkit_gpios),
- .irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
- .wakeup_flag = 1,
- .work_func = alessi_gpio_carkit_work_func,
- .print_state = alessi_gpio_carkit_print_state,
- .sysfs_store = alessi_gpio_carkit_sysfs_store,
- .additional_init = alessi_register_callback,
-};
-
-static struct platform_device alessi_carkit_device = {
- .name = "lge-switch-gpio",
- .id = 0,
- .dev = {
- .platform_data = &alessi_carkit_data,
- },
+ .dev.platform_data = "button-backlight",
};
int alessi_vibrator_power_set(int enable)

0 comments on commit cd15148

Please sign in to comment.
Something went wrong with that request. Please try again.