Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756777AbcK3HwJ (ORCPT ); Wed, 30 Nov 2016 02:52:09 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:49225 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754787AbcK3Hv7 (ORCPT ); Wed, 30 Nov 2016 02:51:59 -0500 X-AuditID: cbfec7f4-f791c6d000006eac-6c-583e851a74bc Subject: Re: [PATCH V3] leds: pca955x: Add ACPI support for pca955x To: Tin Huynh , Mika Westerberg , "Rafael J. Wysocki" , Richard Purdie Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Loc Ho , Thang Nguyen , Phong Vo , patches@apm.com From: Jacek Anaszewski Message-id: <302ebc57-6f52-b0ff-e354-0c67556a88ed@samsung.com> Date: Wed, 30 Nov 2016 08:51:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-version: 1.0 In-reply-to: <1480475311-14385-1-git-send-email-tnhuynh@apm.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA02Se0hTYRjG/TznbMfL6nNavXhJmgYlZRlCh8qh2B8Tgi4EqRC28qDilU0l i2BqW07xui6oYdpSQyXvWl5Slm2UK0vTLuoozIjUSqeiSZnbUfC/5+X9Pe/D8/HRhPAB5UrH JCSzsgRpnIhnT7bplwf2uynFoQczxxFz/VMuyVQ/zUfMUMddHtM6/QgxN9v7+EymcZHHZNUt IsbYP0gxnR2TFKNXhzMrWRoq0EEyWz+HJGUvTktahm+Qkq57S5TE3LTzFBVufyySjYtJZWUH xBfsoz/knkzqdrqs0rbxFWhFkI3saMD+kHFLbcvp7fDGVM/LRva0EFciePVMxbcshNiMYKz6 6oahdPwnwUFVCF4WV5Lc8A3B77oFwkI542CYmP9FWRYuWI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ALCQts5CUzUJS toCReRWjSGppcW56brGRXnFibnFpXrpecn7uJkZgFG479nPLDsaud8GHGAU4GJV4eF9MsI0Q Yk0sK67MPcQowcGsJMLb0GQXIcSbklhZlVqUH19UmpNafIjRFOiJicxSosn5wASRVxJvaGJo bmloZGxhYW5kpCTOO/XDlXAhgfTEktTs1NSC1CKYPiYOTqkGRitZg2Cze0d82XtPi+1z47jt 3eD94tPMpykNlR/ee5Y+PRjstrBv4e7n4WrXbuhn1qnvdEvbX3dvcq++yPUzP4T8Zi9kfvI7 /L9f7OE4sxWq7y/IRrObPP+iPndzS1aq1+w5KXOttZTYKmKi52vFPGdLv9/qyR/zK7U5dtN8 uYVOpo0e+5hblViKMxINtZiLihMB+ZSKedgCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161130075154eucas1p2e8942bae240015e5fd67c741d6856eb2 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?SmFjZWsgQW5hc3pld3NraRtTUlBPTC1TeXN0ZW0gRlcgIChN?= =?UTF-8?B?Qikb7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?SmFjZWsgQW5hc3pld3NraRtTUlBPTC1TeXN0ZW0gRlcgIChN?= =?UTF-8?B?QikbU2Ftc3VuZyBFbGVjdHJvbmljcxtTZW5pb3IgU29mdHdhcmUgRW5naW5l?= =?UTF-8?B?ZXI=?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjc1MjY=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20161130030845epcas5p2369d1c7cabb765ef0039b8e8d5aaa965 X-RootMTR: 20161130030845epcas5p2369d1c7cabb765ef0039b8e8d5aaa965 References: <1480475311-14385-1-git-send-email-tnhuynh@apm.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2157 Lines: 78 Hi Tin, How this patch is different from the one already merged? Best regards, Jacek Anaszewski On 11/30/2016 04:08 AM, Tin Huynh wrote: > This patch enables ACPI support for leds-pca955x driver. > > Signed-off-by: Tin Huynh > --- > drivers/leds/leds-pca955x.c | 22 +++++++++++++++++++++- > 1 files changed, 21 insertions(+), 1 deletions(-) > > Change from V2: > -Correct coding conventions. > > Change from V1: > -Remove CONFIG_ACPI. > > diff --git a/drivers/leds/leds-pca955x.c b/drivers/leds/leds-pca955x.c > index 840401a..b168ebe 100644 > --- a/drivers/leds/leds-pca955x.c > +++ b/drivers/leds/leds-pca955x.c > @@ -40,6 +40,7 @@ > * bits the chip supports. > */ > > +#include > #include > #include > #include > @@ -100,6 +101,15 @@ struct pca955x_chipdef { > }; > MODULE_DEVICE_TABLE(i2c, pca955x_id); > > +static const struct acpi_device_id pca955x_acpi_ids[] = { > + { .id = "PCA9550", .driver_data = pca9550 }, > + { .id = "PCA9551", .driver_data = pca9551 }, > + { .id = "PCA9552", .driver_data = pca9552 }, > + { .id = "PCA9553", .driver_data = pca9553 }, > + { } > +}; > +MODULE_DEVICE_TABLE(acpi, pca955x_acpi_ids); > + > struct pca955x { > struct mutex lock; > struct pca955x_led *leds; > @@ -250,7 +260,16 @@ static int pca955x_probe(struct i2c_client *client, > struct led_platform_data *pdata; > int i, err; > > - chip = &pca955x_chipdefs[id->driver_data]; > + if (id) { > + chip = &pca955x_chipdefs[id->driver_data]; > + } else { > + const struct acpi_device_id *acpi_id; > + > + acpi_id = acpi_match_device(pca955x_acpi_ids, &client->dev); > + if (!acpi_id) > + return -ENODEV; > + chip = &pca955x_chipdefs[acpi_id->driver_data]; > + } > adapter = to_i2c_adapter(client->dev.parent); > pdata = dev_get_platdata(&client->dev); > > @@ -358,6 +377,7 @@ static int pca955x_remove(struct i2c_client *client) > static struct i2c_driver pca955x_driver = { > .driver = { > .name = "leds-pca955x", > + .acpi_match_table = ACPI_PTR(pca955x_acpi_ids), > }, > .probe = pca955x_probe, > .remove = pca955x_remove, >