Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1768430pxy; Thu, 29 Apr 2021 14:14:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz45hr6NALpxpKXRDlqeFTn6GvoxD5QSSy6iWH1xJht1VzNQctXRin/Z6u0KnqTqJOV7F7C X-Received: by 2002:a17:906:bc8e:: with SMTP id lv14mr518493ejb.418.1619730889079; Thu, 29 Apr 2021 14:14:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619730889; cv=none; d=google.com; s=arc-20160816; b=la2qv9VWUSljNeJngqcV/LGowU9SGgTJqYx81dDOS+J1h7hMp1SZMiZIYPzZw6eWK0 aqqvosjfxDEQRA5XkB45eeDW6yEUlWQQ3E0v1jtGBeZXiBZtRUg0BML6z0qExtEwmIGx 9II1nDC03Iwgmm3mKkXsBcLVpRI6rvKervm0dRffd52hoeHdmOuRW8TON2xdR366BuSw jQveB+Aidi13MJO7D0gfRqRqqoQRVpUQrj7bBo+gcf8YwSEk/vJ9wzJUSyUi9ZZIN0lD tsUwUOFHk4c86ig6nGbyWFLW7qikASdfQ9umpX05XckSIeeXXm1+7YYzorw312DFiEwP jiWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=mg/zJ+B/xzelbnFys+MNRADZZjmzXrujYNqMxio0FAQ=; b=jyj8xFtEOOXludyIarWsKVN2NL/OVt22kpJRTGRGYqTGlG4OkhozNT0Yg3Tjr6z4aS uWETya+QDGwdM+XtRi3cMkV/cZli837a7NsUmsLGHUxpGowb3Qv9Fqp/rcMLdGYLyrqT BTL8zMw+vtGuSr06y0G/7N0eFQ0+n31mdYoKP9tMOawsQNWKXzFsWsECLLh+ZFdPYjNP oxX6CEVHUoMZp+sGGpgJgK/uEzjfWAyDr7lGUUtNKifP3wGc6aca7QkDkikexPUdkzO2 5ZscJRnGWtltbDKU36P8SM4XrHMuQ9NVUpReeOMVFDI/AsJ4DFhHIKX+Tgmw+xaSxr9E /C1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kw6si1029940ejc.380.2021.04.29.14.14.24; Thu, 29 Apr 2021 14:14:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235283AbhD2VNP (ORCPT + 99 others); Thu, 29 Apr 2021 17:13:15 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:58834 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234795AbhD2VNM (ORCPT ); Thu, 29 Apr 2021 17:13:12 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 151021C0BA1; Thu, 29 Apr 2021 23:12:24 +0200 (CEST) Date: Thu, 29 Apr 2021 23:12:23 +0200 From: Pavel Machek To: Bjorn Andersson Cc: Dan Murphy , Rob Herring , Andy Gross , Thierry Reding , Uwe Kleine-K?nig , Lee Jones , Martin Botka , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-pwm@vger.kernel.org Subject: Re: [PATCH v6 2/4] leds: Add driver for Qualcomm LPG Message-ID: <20210429211223.GA5480@amd> References: <20201021201224.3430546-1-bjorn.andersson@linaro.org> <20201021201224.3430546-3-bjorn.andersson@linaro.org> <20201029181357.GE26053@duo.ucw.cz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wRRV7LY7NUeQGEoC" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > > +static int lpg_add_pwm(struct lpg *lpg) > > > +{ > > > + int ret; > > > + > > > + lpg->pwm.base =3D -1; > > > + lpg->pwm.dev =3D lpg->dev; > > > + lpg->pwm.npwm =3D lpg->num_channels; > > > + lpg->pwm.ops =3D &lpg_pwm_ops; > > > + > > > + ret =3D pwmchip_add(&lpg->pwm); > > > + if (ret) > > > + dev_err(lpg->dev, "failed to add PWM chip: ret %d\n", ret); > > > + > > > + return ret; > > > +} > >=20 > > Do we need to do this? I'd rather have LED driver, than LED+PWM > > driver... > >=20 >=20 > Yes, I believe we need to do this. >=20 > Because each piece of hardware has N channels, which can be wired to > LEDs, grouped with other channels and wired to multicolor LEDs or be > used as PWM signals. And this configuration is board specific. >=20 > One such example is the laptop in front of me, which has 3 channels > wired to an RGB LED and 1 channel wired as a backlight control signal > (i.e. using pwm-backlight). Another example is a devboard where the > 4 channels are wired to 4 LEDs. Ok, so this is actually important. In this case you should have PWM layer, exporting PWMs, and then rgb-LED driver that takes three of those PWMs and turns them into LED, no? And ... surprise ... that is likely to help other people, as LEDs connected to PWMs are quite common. Hmm.? If you can't do this for some reason, you should probably explain in the changelog, because this is going to be FAQ. Best regards, Pavel --=20 http://www.livejournal.com/~pavelmachek --wRRV7LY7NUeQGEoC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAmCLITcACgkQMOfwapXb+vK+BACeMLv8lEYnpH1WKHwqzQQfYMGc 5O4AoKuyGX4vAejCvrj2ZaEI2S6+fTMH =al0Q -----END PGP SIGNATURE----- --wRRV7LY7NUeQGEoC--