Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1511590imm; Sun, 9 Sep 2018 03:43:28 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaQWY+ktMuhRskIkJTPQXQygZNBU/IGDVOeXUCLQuNBoy7oAtwDzbZabRRlTfn74+IQbV7s X-Received: by 2002:a17:902:3c5:: with SMTP id d63-v6mr16436838pld.145.1536489808497; Sun, 09 Sep 2018 03:43:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536489808; cv=none; d=google.com; s=arc-20160816; b=Xbap5DlFTxdIE9YULaHE+xW0EVnikYzb15lX3fB7sV9MsvnoTl7DjPbGznt8r0V8Ow OqqjSoQikuwAXqqZUZc2A4fDGJ9FNxB0reLBZ3CV+8HQS69czEiHbfXpfg1elkzqVXPU bJYOJLKWULnbzWN/kv29NyVm5z2GAeW7QITFEj4TY5A6NoHzrKrjm84Nyw11Tf0H30DW 0npTjqYKF8gJmDH49rRYBYuIH3Xo9YzLHNPLlfy0p1rECQgepxYr8w1VB/srWYrmN/Ja eouSK4z3Qs9NPELODTlXh4clk6Pzf/bkmeem0kiiC5uhxRU+r0poi413QvXLCqf0a8+H V0Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=WtjxYmEXZlFDYUm6C5/IFEVd2yQ0iFIxxr14eyH1BH8=; b=QkkhAzZDrpUolJ+pPDltwqOavpYhO+oMSEEqbIpevYNrhjdu9RKrOsi6bm1mLR6bFL 7QA5YSMP0uE5V7ezD7s+8D2DCeVPCgf7VJMus5+4TVxrUhjhcskxO0BGnF9m40e40F6I xA8B1i4hrRqQ+aZhAZtprXgmTy1fBkgQEhCzzgNcTc6/vr+juDP5eSvO9ZLqGN+K4tMI KK8HMb1g1n8dzJbElcBZbPVM+0LBBDwaM6T2sGGzV5bzDRCeLz+7Rejxa2z4Apma8xfH x6cj9WmBBIzzdMBCrlc7VYNxzU78JKduYwuIF8n1VjhrrmNVbZ/YnQRSLj0+9dYug/S9 t3yg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d3-v6si14003165pla.37.2018.09.09.03.42.33; Sun, 09 Sep 2018 03:43:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726689AbeIIP2W (ORCPT + 99 others); Sun, 9 Sep 2018 11:28:22 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:46693 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726639AbeIIP2W (ORCPT ); Sun, 9 Sep 2018 11:28:22 -0400 Received: by mail-pl1-f193.google.com with SMTP id t19-v6so8437441ply.13; Sun, 09 Sep 2018 03:39:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=WtjxYmEXZlFDYUm6C5/IFEVd2yQ0iFIxxr14eyH1BH8=; b=GiscW+N8TXjgke5ay9m6DvuLkJvF8qWw0dp9BzvUt+BXjbVX6TamvwIYsO+p1v5/Xx 2kxsZWrZ1J0c6ity0nzzbB9CATJnoSDuNKyhw2W2xpZLcVOfff/4MA2GZZb87AI3D0E6 4A4YFmIzJYOq8Brp6K2dI7TvcUgMyRVGAlf1MrE1drjG719czXBJdQGsPfWgXfHxTkVw F6RsXm74YELcVl7E2TQPXOdp2nUja/USb0qiiL/tF2hEQziTuDax0t311yTBpXAodb1w qUpCbSaBUXj4++jct0X6C2BOjc2Ge5Xcxz/KBZUBvCQaXqIEhWKp2IBZHzFoDIGTvNcX +QMg== X-Gm-Message-State: APzg51CRo8yxL+JaRqD0Uu0K28ziWPdOfVnH9jkHHRcB+FQom0EcGBOK Q+Jxxx/mO0WQ/S2V4PvSEDwN9nAWsGYwhQ== X-Received: by 2002:a17:902:8697:: with SMTP id g23-v6mr16521076plo.292.1536489547592; Sun, 09 Sep 2018 03:39:07 -0700 (PDT) Received: from forlindon.lan (27-32-42-49.static.tpgi.com.au. [27.32.42.49]) by smtp.gmail.com with ESMTPSA id q6-v6sm15984272pgq.19.2018.09.09.03.39.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Sep 2018 03:39:06 -0700 (PDT) From: Simon Shields To: linux-leds@vger.kernel.org Cc: Simon Shields , Jacek Anaszewski , Pavel Machek , Rob Herring , Mark Rutland , devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v5 0/2] Panasonic AN30259A support Date: Sun, 9 Sep 2018 20:38:23 +1000 Message-Id: <20180909103826.17793-1-simon@lineageos.org> X-Mailer: git-send-email 2.18.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, This patch series adds DT bindings (patch #1) and the corresponding driver (patch #2) for the Panasonic AN30259A 3-channel LED driver. AN30259A uses an internal clock for controlling brightness/on-off cycles, but also supports using an external PWM/clock input. This patch series only implements support for the former. The AN30259A is connected using I2C, and the datasheet is freely available[0]. Changes since v4 (mistakenly sent as v3): * Rebased on v4.19-rc2 * Namespace all macros with AN30259A_ prefix * Fix trivial compiler/checkpatch --strict warnings Changes since v3: * Rebased on v4.18-rc3. * Drop unnecessary DUTYMAX/MID calculations when blinking: previously I'd thought that the PWM duty values were expressed as a percentage of the maximum current output, but in reality they're a percentage of the current set in the LEDxCC registers. This simplifies the code quite a bit. * Corrected MODULE_LICENSE declaration. * Return -EINVAL from set_blink if the blink rate is unsupported in hardware. * Fix more checkpatch --strict issues. Changes since v2: * Drop "an30259a:" prefix from bindings and add it in the device driver instead. * Use led-controller instead of leds for sample DT binding. * Use ":indicator" instead of ":notification" in sample DT binding. * Merge an30259a_led_set and an30259a_brightness to an30259a_brightness_set (and same for blink functions). * Explain the range limitations of the AN30259A's sloping mode in the code - the AN30259A only has a 7-bit PWM range in slope mode, and the bottom 3 bits are always set. Changes since v1: * Documentation formatting/grammar fixes. * Use reg property instead of led-sources for leds. * Add default-state support. * Fix auto-probing when built as a module. * Simplified DT parsing code. * Use devm version of led_class_register(). * Fix LED naming scheme. * Fixed checkpatch --strict issues. Cheers, Simon [0]: https://www.alliedelec.com/m/d/a9d2b3ee87c2d1a535a41dd747b1c247.pdf Simon Shields (2): dt-bindings: leds: document Panasonic AN30259A bindings leds: add Panasonic AN30259A support .../bindings/leds/leds-an30259a.txt | 43 ++ drivers/leds/Kconfig | 10 + drivers/leds/Makefile | 1 + drivers/leds/leds-an30259a.c | 368 ++++++++++++++++++ 4 files changed, 422 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/leds-an30259a.txt create mode 100644 drivers/leds/leds-an30259a.c -- 2.18.0