/* LCD BackLight */ static void emxx_brightness_set(struct led_classdev *led_cdev, enum led_brightness value) { int hw_val = (value * HW_MAX_BRIGHTNESS) / 255; if (hw_val < HW_MIN_BRIGHTNESS) hw_val = HW_MIN_BRIGHTNESS; if (hw_val > HW_MAX_BRIGHTNESS) hw_val = HW_MAX_BRIGHTNESS; pwc_reg_write(DA9052_LED1CONT_REG, hw_val); pwc_reg_write(DA9052_LED2CONT_REG, hw_val); }
static int emxx_light_probe(struct platform_device *pdev) { /* Init LCD Backlight */ pwc_reg_write(DA9052_LED1CONF_REG, 0xEA); /* LCD panel max electric current 15mA, set 14.986mA */ pwc_reg_write(DA9052_LED1CONT_REG, 0xDF); pwc_reg_write(DA9052_LED2CONF_REG, 0xEA); /* LCD panel max electric current 15mA, set 14.986mA */ pwc_reg_write(DA9052_LED2CONT_REG, 0xDF); led_classdev_register(&pdev->dev, &emxx_backlight_led); /* Init LED */ platform_device_register(&emxx_leds); return 0; }
/* * DeInit CFI module */ static void emxx_cfi_disable(void) { emxx_reset_device(EMXX_RST_CFI); emxx_close_clockgate(EMXX_CLK_CFI | EMXX_CLK_CFI_H); #ifdef CONFIG_MACH_EMEV if ((system_rev & EMXX_REV_MASK) != EMXX_REV_ES1) { #endif /* CONFIG_MACH_EMEV */ /* card power off */ pwc_reg_write(DA9052_LDO8_REG, 0x00); mdelay(2); #ifdef CONFIG_MACH_EMEV } #endif /* CONFIG_MACH_EMEV */ }
/* * Init CFI module */ static void emxx_cfi_enable(void) { u32 val; #ifdef CONFIG_MACH_EMEV if ((system_rev & EMXX_REV_MASK) != EMXX_REV_ES1) { #endif /* CONFIG_MACH_EMEV */ emxx_reset_device(EMXX_RST_CFI); emxx_close_clockgate(EMXX_CLK_CFI | EMXX_CLK_CFI_H); /* card power on */ pwc_reg_write(DA9052_LDO8_REG, 0x6A); udelay(300); #ifdef CONFIG_MACH_EMEV } #endif /* CONFIG_MACH_EMEV */ emxx_open_clockgate(EMXX_CLK_CFI | EMXX_CLK_CFI_H); emxx_unreset_device(EMXX_RST_CFI); /* config the CFI work in the PIO mode, hardware reset, 16 bit data */ writel(CFI_CONTROL_0_IDE, EMXX_CFI_CONTROL_0); /* hardware reset release in CFI module */ val = readl(EMXX_CFI_CONTROL_0) | CFI_CONTROL_0_HRST; writel(val, EMXX_CFI_CONTROL_0); /* disable all the interrupts */ writel(0x00000000, EMXX_CFI_CONTROL_1); /* clear all the interrupt */ writel(0xffffffff, EMXX_CFI_INTERRUPT); /* PIO mode access timing confige */ writel(0x00001319, EMXX_CFI_TIMING_1); /* setting for PIO */ val = readl(EMXX_CFI_BUSIF_CTRL) & 0xFFFFFF00; writel(val | 0x00000062 | emxx_cfi_burst_mode, EMXX_CFI_BUSIF_CTRL); }