[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <13068cff8e3a994df5d8fbe19deb068a741365f3.camel@suse.de>
Date: Mon, 26 Oct 2020 15:02:58 +0100
From: Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Thierry Reding <thierry.reding@...il.com>,
Lee Jones <lee.jones@...aro.org>,
Florian Fainelli <f.fainelli@...il.com>,
linux-pwm@...r.kernel.org,
bcm-kernel-feedback-list <bcm-kernel-feedback-list@...adcom.com>,
linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
devicetree <devicetree@...r.kernel.org>,
Stefan Wahren <wahrenst@....net>,
linux-input <linux-input@...r.kernel.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"open list:STAGING SUBSYSTEM" <devel@...verdev.osuosl.org>,
Philipp Zabel <p.zabel@...gutronix.de>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
Linus Walleij <linus.walleij@...aro.org>,
linux-clk <linux-clk@...r.kernel.org>,
Stephen Boyd <sboyd@...nel.org>,
linux-rpi-kernel <linux-rpi-kernel@...ts.infradead.org>
Subject: Re: [PATCH v2 10/10] pwm: Add Raspberry Pi Firmware based PWM bus
Hi Andy, thanks for the review!
On Thu, 2020-10-22 at 21:53 +0300, Andy Shevchenko wrote:
> On Thu, Oct 22, 2020 at 9:05 PM Nicolas Saenz Julienne
> <nsaenzjulienne@...e.de> 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.
> > drivers/pwm/pwm-raspberrypi.c | 221 ++++++++++++++++++++++++++++++++++
>
> Name is completely confusing.
> Please, make it unique enough to understand that this is exactly the
> device it serves for.
>
> For example, pwm-rpi-poe is better.
Sounds reasonable, I'll change that.
>
> ...
>
> > + * - Only normal polarity
>
> Can't it be emulated? Isn't it 100% - duty cycle % ?
I guess it can, OTOH given the rather specific use case, I doubt it'll be
worth the effort.
> > +#include <linux/module.h>
> > +#include <linux/of.h>
> > +#include <linux/platform_device.h>
> > +#include <linux/pwm.h>
>
> ...
>
> > + ret = rpi_firmware_property(firmware, RPI_FIRMWARE_SET_POE_HAT_VAL,
> > + &msg, sizeof(msg));
> > + if (ret)
> > + return ret;
> > + else if (msg.ret)
>
> Redundant 'else'
Noted.
> > + firmware_node = of_get_parent(dev->of_node);
> > + if (!firmware_node) {
> > + dev_err(dev, "Missing firmware node\n");
> > + return -ENOENT;
> > + }
> > +
> > + firmware = rpi_firmware_get(firmware_node);
> > + of_node_put(firmware_node);
> > + if (!firmware)
> > + return -EPROBE_DEFER;
>
> Looks like a hack.
This is the pattern we've been using on all firmware dependent devices so far.
Feel free to suggest a better way, I'll be happy to look into it.
>
> ...
>
> > + ret = pwmchip_remove(&rpipwm->chip);
> > + if (!ret)
> > + rpi_firmware_put(rpipwm->firmware);
> > +
> > + return ret;
>
> Can't you use the usual pattern?
Yes of course. Don't know why I went this way.
Regards,
Nicolas
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists