Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935150AbcKWKU7 (ORCPT ); Wed, 23 Nov 2016 05:20:59 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:31578 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934005AbcKWKT2 (ORCPT ); Wed, 23 Nov 2016 05:19:28 -0500 X-AuditID: cbfec7f2-f79556d000002c42-a0-58356d2b595c Subject: Re: [PATCH V1] leds: pca955x: Add ACPI support for pca955x To: tnhuynh@apm.com, Richard Purdie , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Loc Ho , Thang Nguyen , Phong Vo , patches@apm.com, "Rafael J. Wysocki" , Mika Westerberg From: Jacek Anaszewski Message-id: Date: Wed, 23 Nov 2016 11:19:21 +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: <1479890546-22644-1-git-send-email-tnhuynh@apm.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprDKsWRmVeSWpSXmKPExsWy7djPc7rauaYRBjP/Glu03Oplsbi8aw6b xdY36xgtpmw/wm7RfOYbm0XHmm+MFmdOX2K12L3rKavFsc4oi98dk1kduDw+rv/E6DHvZKDH lqvtLB575v9g9fi8SS6ANYrLJiU1J7MstUjfLoErY9qkZ+wFS4Qq7n/8y9zAeJWvi5GTQ0LA ROLB4f9MELaYxIV769m6GLk4hASWMkrs3bObFcL5zCjx5e1J5i5GDrCOffttIeLLGCX27DjB CtItJPCMUeJipx9IjbCAs8TnTaIgYRGBYokf56aDzWEWOMQosfLKTUaQBJuAocTPF6/BNvMK 2El0L2tjAbFZBFQl5j/7wAYyR1QgQmL33VSIEkGJH5PvsYCEOQUcJA40xYGEmQUcJR4s2skK YctLbF7zlhlklYTAPnaJTa+vMkKcLCux6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BqMTDmxFmEiHEmlhW XJl7iFGCg1lJhPdftmmEEG9KYmVValF+fFFpTmrxIUZToB8mMkuJJucDk0FeSbyhiaG5paGR sYWFuZGRkjhvyYcr4UIC6YklqdmpqQWpRTB9TBycUg2MuSKF33y1d37u2ixzRqIj24XtpNjV famXl1bu6L4zx6vySMiNM/ZMf5eUbinvavUxmHfp9aYr+jOvy724tD33xLSDjOcsZY/muk83 MPi4t3x9C/fcmgjhaI4vx8LXa0durDzQd7i7q3Hbb4E5D/Qe7/u4e31+9xum5hv36/jeK/sb ivWf/1y8WomlOCPRUIu5qDgRAMF3TKnOAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161123101923eucas1p1d889b14095fc659309c03e61b17228ff 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: 20161123084915epcas2p4fc418350e07d2c4746333a0da733f40a X-RootMTR: 20161123084915epcas2p4fc418350e07d2c4746333a0da733f40a 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: 2256 Lines: 84 Hi Tin, Thanks for the patch. While adding ACPI support please always add ACPI maintainers on CC. Adding Rafael and Mika. Thanks, Jacek Anaszewski On 11/23/2016 09:42 AM, tnhuynh@apm.com 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, > -- Best regards, Jacek Anaszewski