Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935176AbcKWKVE (ORCPT ); Wed, 23 Nov 2016 05:21:04 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:42211 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935134AbcKWKU6 (ORCPT ); Wed, 23 Nov 2016 05:20:58 -0500 X-AuditID: cbfec7ef-f79e76d000005b57-0c-58356d87e734 Subject: Re: [PATCH V1] leds: pca955x: Add ACPI support for pca955x To: "Thang Q. Nguyen" , Tin Huynh Cc: Richard Purdie , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, Loc Ho , Phong Vo , patches From: Jacek Anaszewski Message-id: <0c2ec3cc-9b8d-6187-54f2-63c1e08bc528@samsung.com> Date: Wed, 23 Nov 2016 11:20:53 +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: Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupileLIzCtJLcpLzFFi42LZduznOd32XNMIgwXPjC1abvWyWFzeNYfN YuubdYwWzWe+sVl0rPnGaLF711NWi2OdURa/OyazOnB4fFz/idFjz/wfrB6fN8kFMEdx2aSk 5mSWpRbp2yVwZay+Z1qwUqLifEsjawPjLoEuRk4OCQETiaftjxkhbDGJC/fWs3UxcnEICSxj lNhyehs7hPOZUeL86mfMMB33Zhxghqv6fPoJI4TzDMiZchmon4NDWMBZ4vMmUZAGEQFXie62 vWDNzAJrGSVezokBsdkEDCV+vnjNBGLzCthJnGvuYwGxWQRUJU78W8UIMkZUIEJi991UiBJB iR+T74GVcAoES+y9vRpqpJXEs3+trBC2vMTmNW/BbpMQmMcu8eXvPHaQORICshKbDkDd7yKx ZjfIlyC2sMSr41vYIWwZic6Og0wQvZMZJS4eu8kK4axmlNjY2ckCUWUt0fD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DE0NzS0MjYwsLcyMjJXHekg9XwoUE0hNLUrNTUwtS i2D6mDg4pRoYc1l0twu8zcuY/LQ55aG/SfYqpdK1naEXpcLY9GwWfzzHatzSVPShwOA0d5lx 06EQ6+1/rSvUKlVVd7plyt25v1alOWW60neGWb4sFz1NfJbq/r+4d2nN621Prk57zG61xnLC unOeG7/HfCh2klzG5Vt2TEOv/V6LeXpopaHs5b9p8dIb2ZcosRRnJBpqMRcVJwIAVeczBb4C AAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161123102054eucas1p1c7677cf4d99923f716dbc5aa87120638 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 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: 20161123084629epcas1p23e8a52957cac1d4ea5694a550cd6971d X-RootMTR: 20161123084629epcas1p23e8a52957cac1d4ea5694a550cd6971d References: <1479890546-22644-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: 3012 Lines: 99 Hi Thang, It is customary to ack the patches using following tag: Acked-by: Your Name Thanks, Jacek Anaszewski On 11/23/2016 09:44 AM, Thang Q. Nguyen wrote: > Acked. > > On Wed, Nov 23, 2016 at 3:42 PM, > wrote: > > From: Tin Huynh > > > This patch enables ACPI support for leds-pca955x driver. > > Signed-off-by: Tin Huynh > > --- > drivers/leds/leds-pca955x.c | 26 +++++++++++++++++++++++++- > 1 files changed, 25 insertions(+), 1 deletions(-) > > diff --git a/drivers/leds/leds-pca955x.c b/drivers/leds/leds-pca955x.c > index 840401a..8770090 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,17 @@ struct pca955x_chipdef { > }; > MODULE_DEVICE_TABLE(i2c, pca955x_id); > > +#ifdef CONFIG_ACPI > +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); > +#endif > + > struct pca955x { > struct mutex lock; > struct pca955x_led *leds; > @@ -250,7 +262,18 @@ 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]; > +#ifdef CONFIG_ACPI > + 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]; > + } > +#endif > adapter = to_i2c_adapter(client->dev.parent); > pdata = dev_get_platdata(&client->dev); > > @@ -358,6 +381,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, > -- > 1.7.1 > > > > > -- > > > > *Thang Q. Nguyen **|**Staff SW Eng.* > > C: +849.7684.7606 |O: +848.3770.0640 > > F: +848.3770.0641 |tqnguyen@apm.com >