[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-id: <552770E4.3070508@samsung.com>
Date: Fri, 10 Apr 2015 15:42:44 +0900
From: Ingi Kim <ingi2.kim@...sung.com>
To: Joe Perches <joe@...ches.com>
Cc: cooloney@...il.com, rpurdie@...ys.net, robh+dt@...nel.org,
pawel.moll@....com, mark.rutland@....com,
ijc+devicetree@...lion.org.uk, galak@...eaurora.org,
sakari.ailus@....fi, j.anaszewski@...sung.com,
varkabhadram@...il.com, sw0312.kim@...sung.com,
cw00.choi@...sung.com, jh80.chung@...sung.com,
ideal.song@...sung.com, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-leds@...r.kernel.org
Subject: Re: [PATCH v5 3/3] leds: Add ktd2692 flash LED driver
Hi Joe,
Thanks for the review.
On 2015년 04월 01일 13:07, Joe Perches wrote:
> On Wed, 2015-04-01 at 12:58 +0900, Ingi Kim wrote:
>> This patch adds a driver to support the ktd2692 flash LEDs.
>> ktd2692 can control flash current by ExpressWire interface.
>
> trivia:
>
>> diff --git a/drivers/leds/leds-ktd2692.c b/drivers/leds/leds-ktd2692.c
> []
>> +static void ktd2692_brightness_set(struct ktd2692_context *led,
>> + enum led_brightness brightness)
>> +{
>> + mutex_lock(&led->lock);
>> +
>> + if (brightness == LED_OFF) {
>> + led->mode = KTD2692_MODE_DISABLE;
>> + gpio_set_value(led->aux_gpio, KTD2692_LOW);
>> + goto out;
>> + }
>> +
>> + ktd2692_expresswire_write(led, KTD2692_REG_MOVIE_CURRENT_BASE |
>> + KTD2692_BRIGHTNESS_RANGE_255_TO_8(brightness));
>> + led->mode = KTD2692_MODE_MOVIE;
>> +
>> +out:
>> + ktd2692_expresswire_write(led, led->mode | KTD2692_REG_MODE_BASE);
>> + mutex_unlock(&led->lock);
>> +}
>
> Perhaps this function would be better with if/else
> without the out: label
>
>> +static int ktd2692_led_flash_strobe_set(struct led_classdev_flash *fled_cdev,
>> + bool state)
>> +{
>> + struct ktd2692_context *led = fled_cdev_to_led(fled_cdev);
>> + struct led_flash_setting *timeout = &fled_cdev->timeout;
>> + u32 flash_tm_reg;
>> +
>> + mutex_lock(&led->lock);
>> +
>> + if (state == 0) {
>> + led->mode = KTD2692_MODE_DISABLE;
>> + gpio_set_value(led->aux_gpio, KTD2692_LOW);
>> + goto done;
>> + }
>> +
>> + flash_tm_reg = GET_TIMEOUT_OFFSET(timeout->val, timeout->step);
>> + ktd2692_expresswire_write(led, flash_tm_reg
>> + | KTD2692_REG_FLASH_TIMEOUT_BASE);
>> +
>> + led->mode = KTD2692_MODE_FLASH;
>> + gpio_set_value(led->aux_gpio, KTD2692_HIGH);
>> +
>> +done:
>> + ktd2692_expresswire_write(led, led->mode | KTD2692_REG_MODE_BASE);
>
> Same if/else with the done: label?
>
>
Sorry about late comments,
It'll be pushed next patch
Thank you
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists