public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingi Kim <ingi2.kim@samsung.com>
To: Jacek Anaszewski <j.anaszewski@samsung.com>
Cc: cooloney@gmail.com, rpurdie@rpsys.net, robh+dt@kernel.org,
	pawel.moll@arm.com, mark.rutland@arm.com,
	ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
	sakari.ailus@iki.fi, varkabhadram@gmail.com,
	sw0312.kim@samsung.com, cw00.choi@samsung.com,
	jh80.chung@samsung.com, ideal.song@samsung.com,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-leds@vger.kernel.org
Subject: Re: [PATCH v5 3/3] leds: Add ktd2692 flash LED driver
Date: Fri, 10 Apr 2015 15:40:44 +0900	[thread overview]
Message-ID: <5527706C.9020300@samsung.com> (raw)
In-Reply-To: <551B948D.5060905@samsung.com>

Hi Jacek,

On 2015년 04월 01일 15:47, Jacek Anaszewski wrote:
> Hi Ingi,
> 
> On 04/01/2015 05:58 AM, Ingi Kim wrote:
>> This patch adds a driver to support the ktd2692 flash LEDs.
>> ktd2692 can control flash current by ExpressWire interface.
>>

...

>> +    ktd2692_init_flash_timeout(flash_timeout_us, &flash_timeout);
>> +
>> +    fled_cdev->timeout = flash_timeout;
>> +    fled_cdev->ops = &flash_ops;
>> +
>> +    led_cdev->name = KTD2692_DEFAULT_NAME;
> 
> Device Tree label should be used for the LED class device name.
> Please refer to :
> Documentation/devicetree/bindings/leds/common.txt
> 
> Also the documentation states that the LED should be represented
> by DT child node of the LED controller.
> 
> You can parse the label as follows:
> 
> led_cdev->name = of_get_property(child, "label", NULL) ? :
>                            child->name;
> 

Sorry about late comments,
I fix the name and DT such as LED style
Thank you!

>> +    led_cdev->brightness_set = ktd2692_led_brightness_set;
>> +    led_cdev->brightness_set_sync = ktd2692_led_brightness_set_sync;
>> +    led_cdev->flags |= LED_CORE_SUSPENDRESUME | LED_DEV_CAP_FLASH;
>> +
>> +    mutex_init(&led->lock);
>> +    INIT_WORK(&led->work_brightness_set, ktd2692_brightness_set_work);
>> +
>> +    platform_set_drvdata(pdev, led);
>> +
>> +    ret = led_classdev_flash_register(&pdev->dev, fled_cdev);
>> +    if (ret) {
>> +        dev_err(&pdev->dev, "can't register LED %s\n", led_cdev->name);
>> +        mutex_destroy(&led->lock);
>> +        return ret;
>> +    }
>> +
>> +    ktd2692_setup(led);
>> +
>> +    return 0;
>> +}
>> +
>> +static int ktd2692_remove(struct platform_device *pdev)
>> +{
>> +    struct ktd2692_context *led = platform_get_drvdata(pdev);
>> +    int ret;
>> +
>> +    led_classdev_flash_unregister(&led->fled_cdev);
>> +    cancel_work_sync(&led->work_brightness_set);
>> +
>> +    ret = regulator_disable(led->regulator);
>> +    if (ret)
>> +        dev_err(&pdev->dev, "Failed to disable supply: %d\n", ret);
>> +
>> +    mutex_destroy(&led->lock);
>> +
>> +    return 0;
>> +}
>> +
>> +static const struct of_device_id ktd2692_match[] = {
>> +    { .compatible = "kinetic,ktd2692", },
>> +    { /* sentinel */ },
>> +};
>> +
>> +static struct platform_driver ktd2692_driver = {
>> +    .driver = {
>> +        .name  = "leds-ktd2692",
>> +        .of_match_table = ktd2692_match,
>> +    },
>> +    .probe  = ktd2692_probe,
>> +    .remove = ktd2692_remove,
>> +};
>> +
>> +module_platform_driver(ktd2692_driver);
>> +
>> +MODULE_AUTHOR("Ingi Kim <ingi2.kim@samsung.com>");
>> +MODULE_DESCRIPTION("Kinetic KTD2692 LED driver");
>> +MODULE_LICENSE("GPL v2");
>>
> 
> 

      reply	other threads:[~2015-04-10  6:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-01  3:58 [PATCH v5 0/3] Add ktd2692 Flash LED driver using LED Flash class Ingi Kim
2015-04-01  3:58 ` [PATCH v5 1/3] of: Add vendor prefix for Kinetic technologies Ingi Kim
2015-04-01  3:58 ` [PATCH v5 2/3] leds: ktd2692: add device tree bindings for ktd2692 Ingi Kim
2015-04-01  3:58 ` [PATCH v5 3/3] leds: Add ktd2692 flash LED driver Ingi Kim
2015-04-01  4:07   ` Joe Perches
2015-04-10  6:42     ` Ingi Kim
2015-04-01  6:47   ` Jacek Anaszewski
2015-04-10  6:40     ` Ingi Kim [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5527706C.9020300@samsung.com \
    --to=ingi2.kim@samsung.com \
    --cc=cooloney@gmail.com \
    --cc=cw00.choi@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ideal.song@samsung.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=j.anaszewski@samsung.com \
    --cc=jh80.chung@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=rpurdie@rpsys.net \
    --cc=sakari.ailus@iki.fi \
    --cc=sw0312.kim@samsung.com \
    --cc=varkabhadram@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox