Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932352AbbDJGk7 (ORCPT ); Fri, 10 Apr 2015 02:40:59 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:10239 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755951AbbDJGkr convert rfc822-to-8bit (ORCPT ); Fri, 10 Apr 2015 02:40:47 -0400 X-AuditID: cbfee690-f796f6d000005054-18-5527706ce8ec MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 8BIT Message-id: <5527706C.9020300@samsung.com> Date: Fri, 10 Apr 2015 15:40:44 +0900 From: Ingi Kim User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 To: Jacek Anaszewski 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 References: <1427860708-32559-1-git-send-email-ingi2.kim@samsung.com> <1427860708-32559-4-git-send-email-ingi2.kim@samsung.com> <551B948D.5060905@samsung.com> In-reply-to: <551B948D.5060905@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDIsWRmVeSWpSXmKPExsWyRsSkWDenQD3UYP0pJYujOycyWVz/8pzV Yv6Rc6wW/W8Wslrs+nuf0eLcq5WMFr1XnzNa3PjVxmpxedccNoutb9YxWiy9fpHJYsL0tSwW rXuPsFvs3vWU1eLM/pVsFjMmv2SzONkxh9FB0GPNvDWMHpf7epk8ds66y+6xcvkXNo/DXxey eGxa1cnmsWf+D1aPvi2rGD0+b5IL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mhIW66FjCNEbq+IUFwPUYG aCBhDWPG04lXWQpui1ZM+/mSqYHxrkAXIyeHhICJRPfHPSwQtpjEhXvr2boYuTiEBBYxSuxc 0gyW4BUQlPgx+R6QzcHBLCAvceRSNoSpLjFlSi5E+QNGif4bjxlB4rwCWhJnzyqBdLIIqEpc eHuPEcRmE1CTuLFiIRNIiahAhET3iUqQsIiAvkRDQx8jyBhmgQ5miUN9P8BqhAXsJH52GoHU gF1zqVEFxOYU0JZY8nID4wRGgVlIbpuFcNsshNsWMDKvYhRNLUguKE5KzzXUK07MLS7NS9dL zs/dxAhOK8+kdjCubLA4xCjAwajEw3sjXj1UiDWxrLgy9xCjBAezkghvZSxQiDclsbIqtSg/ vqg0J7X4EKMp0GsTmaVEk/OBKS+vJN7Q2MTMyNLI3NDCyNhcSZx3jq5cqJBAemJJanZqakFq EUwfEwenVAPj/uUH9zh+YFrG5rOGf6/nFU2XzLP9qxe/L3M4zcu8/TBP/tr/+et3sd7tWjdz msSXYkbONeKyP59Jn+exWr4lw+XoNumnr+fPr1nC9PZKiZJgrJB6uOOhr7c+ivGpd/YF7OCa 8rHw21I1vlgf0ezwBxf0J0zorNm9v/OQ3x6Zc1VfT/H/c2efrcRSnJFoqMVcVJwIAOuPLCdB AwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2928 Lines: 101 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 "); >> +MODULE_DESCRIPTION("Kinetic KTD2692 LED driver"); >> +MODULE_LICENSE("GPL v2"); >> > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/