static void leds_brightness_set(struct led_classdev *led_cdev, enum led_brightness value) { struct aat28xx_driver_data *drvdata = dev_get_drvdata(led_cdev->dev->parent); int brightness; int next; if (!drvdata) { eprintk("Error getting drvier data\n"); return; } brightness = aat28xx_get_intensity(drvdata); next = value * drvdata->max_intensity / LED_FULL; /* If value is not 0, should not backlight off by bongkyu.kim */ if (value !=0 && next == 0) next = 1; dprintk("input brightness value=%d]\n", next); if (brightness != next) { dprintk("brightness[current=%d, next=%d]\n", brightness, next); aat28xx_send_intensity(drvdata, next); } }
static void leds_brightness_set(struct led_classdev *led_cdev, enum led_brightness value) { struct aat28xx_driver_data *drvdata = dev_get_drvdata(led_cdev->dev->parent); int brightness; int next; if (!drvdata) { eprintk("Error getting drvier data\n"); return; } brightness = aat28xx_get_intensity(drvdata); next = value * drvdata->max_intensity / led_cdev->max_brightness; dprintk("input brightness value=%d]\n", next); if (brightness != next) { dprintk("brightness[current=%d, next=%d]\n", brightness, next); aat28xx_send_intensity(drvdata, next); } }
static void leds_brightness_set(struct led_classdev *led_cdev, enum led_brightness value) { struct aat28xx_driver_data *drvdata = dev_get_drvdata(led_cdev->dev->parent); int brightness; int next; if (!drvdata) { eprintk("Error getting drvier data\n"); return; } brightness = aat28xx_get_intensity(drvdata); /* LGE_CHANGE [[email protected]] 2010-06-09, the interpolation of B/L value */ next = bl_value[value * drvdata->max_intensity / LED_FULL]; dprintk("input brightness value=%d]\n", next); if (brightness != next) { dprintk("brightness[current=%d, next=%d]\n", brightness, next); aat28xx_send_intensity(drvdata, next); } }
static int aat28xx_get_brightness(struct backlight_device *bd) { struct aat28xx_driver_data *drvdata = dev_get_drvdata(bd->dev.parent); return aat28xx_get_intensity(drvdata); }