Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757023AbcK3IB6 (ORCPT ); Wed, 30 Nov 2016 03:01:58 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:43466 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753284AbcK3IBs (ORCPT ); Wed, 30 Nov 2016 03:01:48 -0500 X-AuditID: cbfec7f4-f791c6d000006eac-b3-583e876824a3 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: <7efcf021-72c9-328a-ad88-4c226e8b5d6d@samsung.com> Date: Wed, 30 Nov 2016 09:01:41 +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: <302ebc57-6f52-b0ff-e354-0c67556a88ed@samsung.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKKsWRmVeSWpSXmKPExsWy7djPc7oZ7XYRBlNv8lm03OplsVi+r5/R 4vKuOWwWW9+sY7SYsv0Iu0XzmW9sFh1rvjFanDl9idVi966nrBbHOqMsfndMZnXg9vi4/hOj x7yTgR5brrazeOyZ/4PV4/MmuQDWKC6blNSczLLUIn27BK6Mm4tuMBfcFq/497SPpYFxk1AX IyeHhICJxM+F29ghbDGJC/fWs3UxcnEICSxllJh79hwThPOZUeLG025GmI62/VfZIRLLGCXO Pj0K1fKMUWLO9J9gVcICzhKPv7xnBUmICCxmlGi81MoM4jAL7GGU2PVpIhtIFZuAocTPF6+Z QGxeATuJc4+Ws4DYLAKqEl39V4AmcXCICkRI7L6bClEiK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MArMQtIyC0nZLCRl CxiZVzGKpJYW56bnFhvpFSfmFpfmpesl5+duYgTG4bZjP7fsYOx6F3yIUYCDUYmH98UE2wgh 1sSy4srcQ4wSHMxKIrwNTXYRQrwpiZVVqUX58UWlOanFhxhNgZ6YyCwlmpwPTBF5JfGGJobm loZGxhYW5kZGSuK8Uz9cCRcSSE8sSc1OTS1ILYLpY+LglGpgrK2W7zxnYCARe5wp+3yU/9Fv B20+S3wpfuD7J9r7YNnKI9ESLZVLuz1MC0+72ElVFvRI+75Xuz57S89ztYnfJxv8rS8tPvAn IEJK0GNvUAnLYesbLy/ymJ7gXS8k+GDm/LdzizYYvs43Ta++vH5eefPTBZf3G22Sz1RQ2/l9 9Xpf0+PnozYbKLEUZyQaajEXFScCAHxplKjZAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161130080143eucas1p12ad0e1843d14874e01b66fedac812180 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> <302ebc57-6f52-b0ff-e354-0c67556a88ed@samsung.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2937 Lines: 98 On 11/30/2016 08:51 AM, Jacek Anaszewski wrote: > 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 }, >> + { } OK, I see that you brought back explicit properties in the structure initializer. Is there some vital reason for that? You're mentioning "correcting coding conventions" in the patch changelog. checkpatch.pl --strict doesn't complain about that, so what coding conventions you have on mind? >> +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, >> > > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-leds" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > > > -- Best regards, Jacek Anaszewski