Re: [PATCH v2 1/3] misc: servo-pwm: driver for controlling servo motors via PWM

Angelo Compagnucci
2023-02-17T15:42:06Z

On Fri, Feb 17, 2023 at 4:36 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Fri, Feb 17, 2023 at 03:57:28PM +0100, Angelo Compagnucci wrote:
> > This patch adds a simple driver to control servo motor position via
> > PWM signal.
> > The driver allows to set the angle from userspace, while min/max
> > positions duty cycle and the motor degrees aperture are defined in
> > the dts.
> >
> > Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
> > ---
> > MAINTAINERS | 6 ++
> > drivers/misc/Kconfig | 11 +++
> > drivers/misc/Makefile | 1 +
> > drivers/misc/servo-pwm.c | 149 +++++++++++++++++++++++++++++++++++++++
>
> You add sysfs files but do not document them in Documentation/ABI/ which
> is required. Please do so in your next version of this patch.

https://patchwork.ozlabs.org/project/linux-pwm/patch/20230217145731.3018148-2-angelo@amarulasolutions.com/

This patch [2/3] should do what you're asking.

>
> > +static ssize_t degrees_show(struct device *dev, struct device_attribute *attr,
> > + char *buf)
> > +{
> > + struct servo_pwm_data *data = dev_get_drvdata(dev);
> > +
> > + return snprintf(buf, PAGE_SIZE, "%u\n", data->degrees);
>
> sysfs_emit() please.

Will do.

>
> thanks,
>
> greg k-h

--

Angelo Compagnucci

Software Engineer

angelo@amarulasolutions.com
__________________________________
Amarula Solutions SRL

Via le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 (0)42 243 5310
info@amarulasolutions.com

www.amarulasolutions.com

[`as] https://www.amarulasolutions.com|