Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3774274pxu; Mon, 12 Oct 2020 00:09:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkJILierLOsQq77Mg/AJM82agcDY0nx4Vqd2Rd4nocqNBCZ0rAQgA2jbtjJ02hAjeLWEmX X-Received: by 2002:a50:b023:: with SMTP id i32mr12173681edd.357.1602486551458; Mon, 12 Oct 2020 00:09:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602486551; cv=none; d=google.com; s=arc-20160816; b=t8T9MJeqYNvCALnkHr+QOKHJw807N7HFI5Y0OBBH6GFXyYQL8ynOhfkxkMhMs/jKXA +OM4ZEfRwJM1JOr5eaZTGjGYon5Lbm3svQ7jXdq5U8LeU60sExqMfmEkIv5pdEwPI83a nZts5dgug61fmTbEVxya1TmKBZL5ZqDuGsXyYQ+SDxtwghTUEpKVaUF7/HxZj8g5tRcs UTlo9J1Ei6gAMqrdGoxQ//G4lxi9kaGSWu9tH2RcdsNbtxcu/Xu8dN6+OkFTN1qB0AlD nSZHNT4LegaE898gyO4P8bocrSLZWeDLZnSjphPFwXqcA48TqbMyTTuVZsxtm5RhBLtB KXmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:autocrypt:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=LwrUCDOKQiaICLoS52Fct605oHdTlMe99j26p0vvR1I=; b=xgCbUdBxpGaYmUgzGeKtE/kzUbAz+Aw7CsL7bmsbGshROoOOGo7pu82gR/jUuWuz4+ UJfP6FtVwELgopH49X+inYxDgDiiRNbTTaPwW+kLKrKNatis7iekRc+SrOTHqYIWfTwO aRl7UBIE4ukzyE218xgA0VxBqNq85svJh2DM8DdDkjO3Zp7CxgcQBCAYN3RXzKjCFyPM FJEfTvoqPBbS5pNajHC/NpOei6+1itdXI6UXWb7n3d4MtjmKBbVEFx8AhVc6pqwbmyWd NYs61TF2u4stsx+697jr0t60uf/FutjxkeUlqshv1tLhVc6ldHxw9isO089M/a7LW4U3 imYw== 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 rv16si11306391ejb.636.2020.10.12.00.08.48; Mon, 12 Oct 2020 00:09:11 -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 S1726790AbgJLHGq (ORCPT + 99 others); Mon, 12 Oct 2020 03:06:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726719AbgJLHGp (ORCPT ); Mon, 12 Oct 2020 03:06:45 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06B5DC0613D0 for ; Mon, 12 Oct 2020 00:06:45 -0700 (PDT) Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kRrud-0001rS-L8; Mon, 12 Oct 2020 09:06:27 +0200 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1kRruc-0005R7-KO; Mon, 12 Oct 2020 09:06:26 +0200 Date: Mon, 12 Oct 2020 09:06:26 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Nicolas Saenz Julienne Cc: f.fainelli@gmail.com, linux@roeck-us.net, jdelvare@suse.com, wahrenst@gmx.net, Eric Anholt , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-pwm@vger.kernel.org, Thierry Reding , Lee Jones , linux-hwmon@vger.kernel.org, robh+dt@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] pwm: Add Raspberry Pi Firmware based PWM bus Message-ID: <20201012070626.fzjhp3tkmgglqnm4@pengutronix.de> References: <20201009153031.986-1-nsaenzjulienne@suse.de> <20201009153031.986-4-nsaenzjulienne@suse.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mdjz5hjh2cw74st5" Content-Disposition: inline In-Reply-To: <20201009153031.986-4-nsaenzjulienne@suse.de> Autocrypt: addr=u.kleine-koenig@pengutronix.de; keydata= mQINBEwXmCYBEACoJSJcKIlkQcTYia0ymmMOBk2veFoy/a0LlqGUEjQ4WECBL19F2BYX1dSp5/Z dfKuV605usI6oq4x6k/LKmqZDl6YnqW/YmN/iZVCRunBRfvpTlL4lcNUu5Va/4GBRzBRrrrIhCI VL5zMV6hKywhHKTdOHVSZRftf+eRSBwENKXahmfOMDmekyf585etDPdzkFrLHNVFOCsFOU0gCK0 uVPyY0LH13eo4qEEMi88RCOfwYCFQqKXDdo41DWoDPB5OGCMaphIx9wC/nvtdcvMowsGde5iGgm HWK6sdC/O/xaV7fnz1sJzoJB1eT91LkGbdGxsLAT6nqlaNJiJtiBoRhscguVxVbn/I9mnUu7bLm TFBEAlaQGU/J7uQ4w94FXfosNGROt/otqltetMZlPbNvNhKnXv8U6eRyAP3ZMKTJa4hGr3UdYdt 4+MIiHcsANWp8T7oLYVxRbHPXPG49IURnhXUoGbscZmpptWcl29eboqCxL9n3KIyUT3ZB1xHbW3 Sk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YetaZV5Ykiv6j2NhLg9w9WlzcnwbekZ1+756zNwqMPVM9eD7Rkwk b8jUtZxaQSze5ujaldq70fo/ME3NEJxn/3R6/Tb/7o7QFsmUDI60JVMfXdoPV1JD4gxIvzerxbW hqn7+OJPf+GWs7LF9VEr+d1F+TOeUlZk27gaBhU9JrCD3lno25y+wMIHKCJc/XzE/pjKXdiV0FL eMyBWqsy1Z+NnlBDZKvro3uR5KzaZ1NRKZIF03sPXiQlcSNeoWiBKHKVZ4qnKBsXOEp1Wi/zp7B EdQToTe9KOoT9+Njil0kBAgYA+hdQ8JCesHCzmUVg9BMUHOtOyo/wKCX9jPgvWMoNjetbgnIFYM EEQBrXD+3jop3PH7fC5PYogrrNXBIBJEKS+bnJ6VdifebvvFaxBBGpTC3qTASqqALgCEp+sVF3t Igm+K3Up8pzY2t1cqoP8UMvtQRxyCDkLQLg8Fr2DoGnsSc6fB4BWifIsYoI0lwjpRkAAD5IcGdn 8ZfeQOAVnw+FA0IC/OOuKEy0/aazA0DK5iBjn4JmgW4QneWMEE7yh4kWlZIkmH8p1hhVkCjcbgN D0TZnv5x48nA0bXApY48aVFT2EbDZz1k3QCmiT5ALbl1M4YYyLw== X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --mdjz5hjh2cw74st5 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, On Fri, Oct 09, 2020 at 05:30:30PM +0200, Nicolas Saenz Julienne wrote: > Adds support to control the PWM bus available in official Raspberry Pi > PoE HAT. Only RPi's co-processor has access to it, so commands have to > be sent through RPi's firmware mailbox interface. >=20 > Signed-off-by: Nicolas Saenz Julienne > --- > drivers/pwm/Kconfig | 7 ++ > drivers/pwm/Makefile | 1 + > drivers/pwm/pwm-raspberrypi.c | 216 ++++++++++++++++++++++++++++++++++ > 3 files changed, 224 insertions(+) > create mode 100644 drivers/pwm/pwm-raspberrypi.c >=20 > diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig > index 63be5362fd3a..a76997ca37d0 100644 > --- a/drivers/pwm/Kconfig > +++ b/drivers/pwm/Kconfig > @@ -379,6 +379,13 @@ config PWM_PXA > To compile this driver as a module, choose M here: the module > will be called pwm-pxa. > =20 > +config PWM_RASPBERRYPI > + tristate "Raspberry Pi Firwmware PWM support" s/Firwmware/Firmware/ > + depends on RASPBERRYPI_FIRMWARE || (COMPILE_TEST && !RASPBERRYPI_FIRMWA= RE) This is more complicated than necessary. depends on RASPBERRYPI_FIRMWARE || COMPILE_TEST is logically equivalent. > + help > + Enable Raspberry Pi firmware controller PWM bus used to control the > + official RPI PoE hat > + > config PWM_RCAR > tristate "Renesas R-Car PWM support" > depends on ARCH_RENESAS || COMPILE_TEST > diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile > index cbdcd55d69ee..b557b549d9f3 100644 > --- a/drivers/pwm/Makefile > +++ b/drivers/pwm/Makefile > @@ -35,6 +35,7 @@ obj-$(CONFIG_PWM_MXS) +=3D pwm-mxs.o > obj-$(CONFIG_PWM_OMAP_DMTIMER) +=3D pwm-omap-dmtimer.o > obj-$(CONFIG_PWM_PCA9685) +=3D pwm-pca9685.o > obj-$(CONFIG_PWM_PXA) +=3D pwm-pxa.o > +obj-$(CONFIG_PWM_RASPBERRYPI) +=3D pwm-raspberrypi.o > obj-$(CONFIG_PWM_RCAR) +=3D pwm-rcar.o > obj-$(CONFIG_PWM_RENESAS_TPU) +=3D pwm-renesas-tpu.o > obj-$(CONFIG_PWM_ROCKCHIP) +=3D pwm-rockchip.o > diff --git a/drivers/pwm/pwm-raspberrypi.c b/drivers/pwm/pwm-raspberrypi.c > new file mode 100644 > index 000000000000..1ccff6b1ae34 > --- /dev/null > +++ b/drivers/pwm/pwm-raspberrypi.c > @@ -0,0 +1,216 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright 2020 Nicolas Saenz Julienne > + */ Please add a paragraph here about the hardware. See pwm-sifive.c for a template. (Please stick to the format there to simplify grepping.) The things to point out there are: - No disable bit, so a disabled PWM is simulated by duty_cycle 0 - Only normal polarity - Fixed period Also add a note about if the currently running period is completed when the hardware is reconfigured. If possible please also add a link to a product page and/or documentation. > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +#define RPI_PWM_MAX_DUTY 255 > +#define RPI_PWM_PERIOD_NS 80000 /* 12.5KHz */ 12.5 kHz > +#define RPI_PWM_CUR_DUTY_REG 0x0 > +#define RPI_PWM_DEF_DUTY_REG 0x1 > + > +struct raspberrypi_pwm { > + struct rpi_firmware *firmware; > + struct pwm_chip chip; > + unsigned int duty_cycle; > +}; > + > +struct raspberrypi_pwm_prop { > + __le32 reg; > + __le32 val; > + __le32 ret; > +} __packed; > + > +static inline struct raspberrypi_pwm *to_raspberrypi_pwm(struct pwm_chip= *chip) > +{ > + return container_of(chip, struct raspberrypi_pwm, chip); > +} > + > +static int raspberrypi_pwm_set_property(struct rpi_firmware *firmware, > + u32 reg, u32 val) > +{ > + struct raspberrypi_pwm_prop msg =3D { > + .reg =3D cpu_to_le32(reg), > + .val =3D cpu_to_le32(val), > + }; > + int ret; > + > + ret =3D rpi_firmware_property(firmware, RPI_FIRMWARE_SET_POE_HAT_VAL, > + &msg, sizeof(msg)); > + if (ret) > + return ret; > + else if (msg.ret) > + return -EIO; > + > + return 0; > +} > + > +static int raspberrypi_pwm_get_property(struct rpi_firmware *firmware, > + u32 reg, u32 *val) > +{ > + struct raspberrypi_pwm_prop msg =3D { > + .reg =3D reg > + }; > + int ret; > + > + ret =3D rpi_firmware_property(firmware, RPI_FIRMWARE_GET_POE_HAT_VAL, > + &msg, sizeof(msg)); > + if (ret) > + return ret; > + else if (msg.ret) > + return -EIO; > + > + *val =3D le32_to_cpu(msg.val); > + > + return 0; > +} > + > +static void raspberrypi_pwm_get_state(struct pwm_chip *chip, > + struct pwm_device *pwm, > + struct pwm_state *state) > +{ > + struct raspberrypi_pwm *pc =3D to_raspberrypi_pwm(chip); > + > + state->period =3D RPI_PWM_PERIOD_NS; > + state->duty_cycle =3D pc->duty_cycle * RPI_PWM_PERIOD_NS / RPI_PWM_MAX_= DUTY; Please round up the result of the division. (The idea is that if you apply the state .get_state() returns this should yield no change.) > + state->enabled =3D !!(pc->duty_cycle); > + state->polarity =3D PWM_POLARITY_NORMAL; > +} > + > +static int raspberrypi_pwm_apply(struct pwm_chip *chip, struct pwm_devic= e *pwm, > + const struct pwm_state *state) > +{ > + struct raspberrypi_pwm *pc =3D to_raspberrypi_pwm(chip); > + unsigned int duty_cycle; > + int ret; > + You need to check for polarity here. > + if (!state->enabled) > + duty_cycle =3D 0; > + else > + duty_cycle =3D state->duty_cycle * RPI_PWM_MAX_DUTY / > + RPI_PWM_PERIOD_NS; > + > + if (duty_cycle =3D=3D pc->duty_cycle) > + return 0; > + > + pc->duty_cycle =3D duty_cycle; > + ret =3D raspberrypi_pwm_set_property(pc->firmware, RPI_PWM_CUR_DUTY_REG, > + pc->duty_cycle); > + if (ret) { > + dev_err(chip->dev, "Failed to set duty cycle: %d\n", ret); > + return ret; > + } What happens if duty_cycle happens to be bigger than RPI_PWM_MAX_DUTY? I think the right thing to do here is: if (state->period < RPI_PWM_PERIOD_NS || state->polarity !=3D PWM_POLARITY_NORMAL) return -EINVAL; if (!state->enabled) duty_cycle =3D 0 else if (state->duty_cycle < RPI_PWM_PERIOD_NS) duty_cycle =3D state->duty_cycle * RPI_PWM_MAX_DUTY / RPI_PWM_PERIOD_NS; else duty_cycle =3D RPI_PWM_MAX_DUTY; ret =3D raspberrypi_pwm_set_property(pc->firmware, RPI_PWM_CUR_DUTY_REG, pc->duty_cycle); if (ret) ... pc->duty_cycle =3D duty_cycle; > + > + ret =3D raspberrypi_pwm_set_property(pc->firmware, RPI_PWM_CUR_DUTY_REG, > + pc->duty_cycle); > + if (ret) { > + dev_err(chip->dev, "Failed to set default duty cycle: %d\n", ret); > + return ret; > + } Huh, why do you have to do this twice, just with different error messages? I assume you want to set RPI_PWM_DEF_DUTY_REG? What is the effect of writing this property? > + > + return 0; > +} > + > +static const struct pwm_ops raspberrypi_pwm_ops =3D { > + .get_state =3D raspberrypi_pwm_get_state, > + .apply =3D raspberrypi_pwm_apply, > + .owner =3D THIS_MODULE, > +}; > + > +static struct pwm_device *raspberrypi_pwm_xlate(struct pwm_chip *pc, > + const struct of_phandle_args *args) > +{ > + struct pwm_device *pwm; > + > + if (args->args[0] >=3D pc->npwm) > + return ERR_PTR(-EINVAL); > + > + pwm =3D pwm_request_from_chip(pc, args->args[0], NULL); > + if (IS_ERR(pwm)) > + return pwm; > + > + /* Firmwre won't let us change the period */ Firmware. > + pwm->args.period =3D RPI_PWM_PERIOD_NS; > + > + return pwm; > +} I think you don't need this function. Just fix up period in .apply(). > +static int raspberrypi_pwm_probe(struct platform_device *pdev) > +{ > + struct device_node *firmware_node; > + struct device *dev =3D &pdev->dev; > + struct rpi_firmware *firmware; > + struct raspberrypi_pwm *pc; What does "pc" stand for? I'd have used "rpipwm" or something similar. > + int ret; > + > + firmware_node =3D of_get_parent(dev->of_node); > + if (!firmware_node) { > + dev_err(dev, "Missing firmware node\n"); > + return -ENOENT; > + } > + > + firmware =3D rpi_firmware_get(firmware_node); > + of_node_put(firmware_node); > + if (!firmware) > + return -EPROBE_DEFER; I don't see a mechanism that prevents the driver providing the firmware going away while the PWM is still in use. > + pc =3D devm_kzalloc(&pdev->dev, sizeof(*pc), GFP_KERNEL); > + if (!pc) > + return -ENOMEM; > [...] > + > +static struct platform_driver raspberrypi_pwm_driver =3D { > + .driver =3D { > + .name =3D "raspberrypi-pwm", > + .of_match_table =3D raspberrypi_pwm_of_match, > + }, > + .probe =3D raspberrypi_pwm_probe, > + .remove =3D raspberrypi_pwm_remove, > +}; > +module_platform_driver(raspberrypi_pwm_driver); > + > +MODULE_AUTHOR("Nicolas Saenz Julienne "); > +MODULE_DESCRIPTION("Raspberry Pi Firwmare Based PWM Bus Driver"); > +MODULE_LICENSE("GPL v2"); > + Please drop the empty line at the end of file. Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --mdjz5hjh2cw74st5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAl+EAG8ACgkQwfwUeK3K 7AkpWgf/ZsEIZnk26F7c2qBvJ4TADC8dLfI+w+tcELnzae+u4XikJ7scnpPs/pna ypAP0jE/bAfr4Q2Oa0Q0Z8kg20A7IYpVc3ezvl3560crq+4ai0rIQrN2WhPqsI3h 9CxA8+NMOZOgCKm+6fwiS6/jCzYmFl2d9elTq4ggDKsBV5wNMm910KkplWMZLy4X Ht4CPRwpKuChC9IOmgxSX/0FeLFfgw5Oya54nkWH42WJcXbpeWnHp8Z6fc/Fdvfz 1MCLCng6BsB/wl7vqpjIxEz9MBKlcTLMVO76UfbZJs/8IeB6q+h6qqu6ihH8Mz7C IlGLL5eKOOdBtcUUttPChLJ5FIID1A== =4h0s -----END PGP SIGNATURE----- --mdjz5hjh2cw74st5--