From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F20AC433DF for ; Tue, 11 Aug 2020 10:31:17 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3384D205CB for ; Tue, 11 Aug 2020 10:31:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ypVRZIEK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3384D205CB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Ncrtw4wJ72BeuGRKMysi4Ew4btlZu4vwHvI4hXt5VJc=; b=ypVRZIEKkQzc/fWM5rQdr4TWF EvhOxInmj2CJ/8stdwsz8a1CqaGflnLMrl3jrPEnGIf6smcNqa74nTH2t/4absaVUgFhYVTGWJtlN RxD31asgloq7mLSnvbkvxVyxdjA3XTfTOfbXlc4tIOoH6dSmSg12P+AZMySkeSJ/kwPcqTrYzZinW AQ79UFEk7Jekj8iaBLEX3A+8fpLIObNvA0OyP+tEfEimfbWAJEcHdIMKD9MFuskSCV/wIFq76dkxe k3FhQfawwtuD2FmrCg2drWNzYp9YWNOzTLAmsv0mh5nXl8LnHAp5+8yvH5NIUUngN7nOiE60B6Yzg MPmuBxX/g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k5RXa-0000bq-1s; Tue, 11 Aug 2020 10:29:58 +0000 Received: from jabberwock.ucw.cz ([46.255.230.98]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k5RXX-0000bU-Hd for linux-arm-kernel@lists.infradead.org; Tue, 11 Aug 2020 10:29:56 +0000 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 809AD1C0BDD; Tue, 11 Aug 2020 12:29:53 +0200 (CEST) Date: Tue, 11 Aug 2020 12:29:53 +0200 From: Pavel Machek To: Dan Murphy Subject: Re: [PATCH v32 2/6] leds: lp50xx: Add the LP50XX family of the RGB LED driver Message-ID: <20200811102953.nio3rslben3oymxb@duo.ucw.cz> References: <20200722153146.8767-1-dmurphy@ti.com> <20200722153146.8767-3-dmurphy@ti.com> MIME-Version: 1.0 In-Reply-To: <20200722153146.8767-3-dmurphy@ti.com> User-Agent: NeoMutt/20180716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200811_062955_711704_FA425AA4 X-CRM114-Status: GOOD ( 18.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, robh@kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, marek.behun@nic.cz, jacek.anaszewski@gmail.com, linux-leds@vger.kernel.org Content-Type: multipart/mixed; boundary="===============1478058305791119505==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============1478058305791119505== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lntfdynxwgttg4sl" Content-Disposition: inline --lntfdynxwgttg4sl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > Introduce the LP5036/30/24/18/12/9 RGB LED driver. > The difference in these parts are the number of > LED outputs where the: >=20 > LP5036 can control 36 LEDs > LP5030 can control 30 LEDs > LP5024 can control 24 LEDs > LP5018 can control 18 LEDs > LP5012 can control 12 LEDs > LP5009 can control 9 LEDs >=20 > The device has the ability to group LED outputs into control banks > so that multiple LED banks can be controlled with the same mixing and > brightness. Or the LED outputs can also be controlled independently. >=20 > diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c > new file mode 100644 > index 000000000000..f4ef9b7f21b2 > --- /dev/null > +++ b/drivers/leds/leds-lp50xx.c > @@ -0,0 +1,791 @@ > +// SPDX-License-Identifier: GPL-2.0 > +// TI LP50XX LED chip family driver > +// Copyright (C) 2018 Texas Instruments Incorporated - https://www.ti.co= m/ I assume 2018-2020 > +#define LP5012_OUT0_CLR 0x0b > +#define LP5012_OUT1_CLR 0x0c > +#define LP5012_OUT2_CLR 0x0d > +#define LP5012_OUT3_CLR 0x0e > +#define LP5012_OUT4_CLR 0x0f > +#define LP5012_OUT5_CLR 0x10 > +#define LP5012_OUT6_CLR 0x11 > +#define LP5012_OUT7_CLR 0x12 > +#define LP5012_OUT8_CLR 0x13 > +#define LP5012_OUT9_CLR 0x14 > +#define LP5012_OUT10_CLR 0x15 > +#define LP5012_OUT11_CLR 0x16 > + > +#define LP5024_OUT0_CLR 0x0f > +#define LP5024_OUT1_CLR 0x10 > +#define LP5024_OUT2_CLR 0x11 > +#define LP5024_OUT3_CLR 0x12 > +#define LP5024_OUT4_CLR 0x13 > +#define LP5024_OUT5_CLR 0x14 > +#define LP5024_OUT6_CLR 0x15 > +#define LP5024_OUT7_CLR 0x16 > +#define LP5024_OUT8_CLR 0x17 > +#define LP5024_OUT9_CLR 0x18 > +#define LP5024_OUT10_CLR 0x19 > +#define LP5024_OUT11_CLR 0x1a > +#define LP5024_OUT12_CLR 0x1b > +#define LP5024_OUT13_CLR 0x1c > +#define LP5024_OUT14_CLR 0x1d > +#define LP5024_OUT15_CLR 0x1e > +#define LP5024_OUT16_CLR 0x1f > +#define LP5024_OUT17_CLR 0x20 > +#define LP5024_OUT18_CLR 0x21 > +#define LP5024_OUT19_CLR 0x22 > +#define LP5024_OUT20_CLR 0x23 > +#define LP5024_OUT21_CLR 0x24 > +#define LP5024_OUT22_CLR 0x25 > +#define LP5024_OUT23_CLR 0x26 > +#define LP5036_OUT0_CLR 0x14 > +#define LP5036_OUT1_CLR 0x15 > +#define LP5036_OUT2_CLR 0x16 > +#define LP5036_OUT3_CLR 0x17 > +#define LP5036_OUT4_CLR 0x18 > +#define LP5036_OUT5_CLR 0x19 > +#define LP5036_OUT6_CLR 0x1a > +#define LP5036_OUT7_CLR 0x1b > +#define LP5036_OUT8_CLR 0x1c > +#define LP5036_OUT9_CLR 0x1d > +#define LP5036_OUT10_CLR 0x1e > +#define LP5036_OUT11_CLR 0x1f > +#define LP5036_OUT12_CLR 0x20 > +#define LP5036_OUT13_CLR 0x21 > +#define LP5036_OUT14_CLR 0x22 > +#define LP5036_OUT15_CLR 0x23 > +#define LP5036_OUT16_CLR 0x24 > +#define LP5036_OUT17_CLR 0x25 > +#define LP5036_OUT18_CLR 0x26 > +#define LP5036_OUT19_CLR 0x27 > +#define LP5036_OUT20_CLR 0x28 > +#define LP5036_OUT21_CLR 0x29 > +#define LP5036_OUT22_CLR 0x2a > +#define LP5036_OUT23_CLR 0x2b > +#define LP5036_OUT24_CLR 0x2c > +#define LP5036_OUT25_CLR 0x2d > +#define LP5036_OUT26_CLR 0x2e > +#define LP5036_OUT27_CLR 0x2f > +#define LP5036_OUT28_CLR 0x30 > +#define LP5036_OUT29_CLR 0x31 > +#define LP5036_OUT30_CLR 0x32 > +#define LP5036_OUT31_CLR 0x33 > +#define LP5036_OUT32_CLR 0x34 > +#define LP5036_OUT33_CLR 0x35 > +#define LP5036_OUT34_CLR 0x36 > +#define LP5036_OUT35_CLR 0x37 These are really useless. Please get rid of them. > +#define LP5009_MAX_LED_MODULES 2 > +#define LP5012_MAX_LED_MODULES 4 > +#define LP5018_MAX_LED_MODULES 6 > +#define LP5024_MAX_LED_MODULES 8 > +#define LP5030_MAX_LED_MODULES 10 > +#define LP5036_MAX_LED_MODULES 12 > + > +#define LP5009_MAX_LEDS (LP5009_MAX_LED_MODULES * LP50XX_LEDS_PER_MODULE) > +#define LP5012_MAX_LEDS (LP5012_MAX_LED_MODULES * LP50XX_LEDS_PER_MODULE) > +#define LP5018_MAX_LEDS (LP5018_MAX_LED_MODULES * LP50XX_LEDS_PER_MODULE) > +#define LP5024_MAX_LEDS (LP5024_MAX_LED_MODULES * LP50XX_LEDS_PER_MODULE) > +#define LP5030_MAX_LEDS (LP5030_MAX_LED_MODULES * LP50XX_LEDS_PER_MODULE) > +#define LP5036_MAX_LEDS (LP5036_MAX_LED_MODULES * LP50XX_LEDS_PER_MODUL= E) As are these. In general, when define is used just once, please think if we really need it. > +static int lp50xx_probe_dt(struct lp50xx *priv) > +{ > + struct fwnode_handle *child =3D NULL; > + struct fwnode_handle *led_node =3D NULL; > + struct led_init_data init_data =3D {}; > + struct led_classdev *led_cdev; > + struct mc_subled *mc_led_info; > + struct lp50xx_led *led; > + int num_colors; > + u32 color_id; > + size_t i =3D 0; No reason this has to be size_t. Int? Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --lntfdynxwgttg4sl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCXzJzIQAKCRAw5/Bqldv6 8jwAAJ9Yru0d8eEJ1s1ZPt666hXIlgwzaACfS9DsSExP7fW6ZZqe9kNSlcJo06A= =DGUE -----END PGP SIGNATURE----- --lntfdynxwgttg4sl-- --===============1478058305791119505== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============1478058305791119505==--