[PATCH v2 1/2] pwm: Manage owner assignment implicitly for drivers

nobuhiro1.iwamatsu at toshiba.co.jp nobuhiro1.iwamatsu at toshiba.co.jp
Mon Aug 7 00:46:27 UTC 2023


Hi Uwe,

> -----Original Message-----
> From: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> Sent: Friday, August 4, 2023 11:27 PM
> To: Thierry Reding <thierry.reding at gmail.com>; Laurent Pinchart
> <Laurent.pinchart at ideasonboard.com>
> Cc: Linus Walleij <linus.walleij at linaro.org>; Bartosz Golaszewski
> <brgl at bgdev.pl>; Andy Shevchenko <andy at kernel.org>; Douglas Anderson
> <dianders at chromium.org>; Andrzej Hajda <andrzej.hajda at intel.com>; Neil
> Armstrong <neil.armstrong at linaro.org>; Robert Foss <rfoss at kernel.org>;
> Jonas Karlman <jonas at kwiboo.se>; Jernej Skrabec
> <jernej.skrabec at gmail.com>; David Airlie <airlied at gmail.com>; Daniel Vetter
> <daniel at ffwll.ch>; Pavel Machek <pavel at ucw.cz>; Lee Jones
> <lee at kernel.org>; Hector Martin <marcan at marcan.st>; Sven Peter
> <sven at svenpeter.dev>; Alyssa Rosenzweig <alyssa at rosenzweig.io>; Nicolas
> Ferre <nicolas.ferre at microchip.com>; Alexandre Belloni
> <alexandre.belloni at bootlin.com>; Claudiu Beznea
> <claudiu.beznea at microchip.com>; Ray Jui <rjui at broadcom.com>; Scott
> Branden <sbranden at broadcom.com>; Broadcom internal kernel review list
> <bcm-kernel-feedback-list at broadcom.com>; Florian Fainelli
> <florian.fainelli at broadcom.com>; Alexander Shiyan <shc_work at mail.ru>;
> Benson Leung <bleung at chromium.org>; Guenter Roeck
> <groeck at chromium.org>; Shawn Guo <shawnguo at kernel.org>; Sascha
> Hauer <s.hauer at pengutronix.de>; Pengutronix Kernel Team
> <kernel at pengutronix.de>; Fabio Estevam <festevam at gmail.com>; NXP
> Linux Team <linux-imx at nxp.com>; Paul Cercueil <paul at crapouillou.net>;
> Vladimir Zapolskiy <vz at mleia.com>; Kevin Hilman <khilman at baylibre.com>;
> Jerome Brunet <jbrunet at baylibre.com>; Martin Blumenstingl
> <martin.blumenstingl at googlemail.com>; Conor Dooley
> <conor.dooley at microchip.com>; Daire McNamara
> <daire.mcnamara at microchip.com>; Matthias Brugger
> <matthias.bgg at gmail.com>; AngeloGioacchino Del Regno
> <angelogioacchino.delregno at collabora.com>; Jonathan Neuschäfer
> <j.neuschaefer at gmx.net>; Heiko Stuebner <heiko at sntech.de>; Krzysztof
> Kozlowski <krzysztof.kozlowski at linaro.org>; Alim Akhtar
> <alim.akhtar at samsung.com>; Palmer Dabbelt <palmer at dabbelt.com>; Paul
> Walmsley <paul.walmsley at sifive.com>; Michael Walle <michael at walle.cc>;
> Orson Zhai <orsonzhai at gmail.com>; Baolin Wang
> <baolin.wang at linux.alibaba.com>; Chunyan Zhang
> <zhang.lyra at gmail.com>; Fabrice Gasnier <fabrice.gasnier at foss.st.com>;
> Maxime Coquelin <mcoquelin.stm32 at gmail.com>; Alexandre Torgue
> <alexandre.torgue at foss.st.com>; Chen-Yu Tsai <wens at csie.org>; Samuel
> Holland <samuel at sholland.org>; Hammer Hsieh
> <hammerh0314 at gmail.com>; Jonathan Hunter <jonathanh at nvidia.com>;
> iwamatsu nobuhiro(岩松 信洋 ○DITC□DIT○OST)
> <nobuhiro1.iwamatsu at toshiba.co.jp>; Sean Anderson
> <sean.anderson at seco.com>; Michal Simek <michal.simek at amd.com>;
> Johan Hovold <johan at kernel.org>; Alex Elder <elder at kernel.org>; Greg
> Kroah-Hartman <gregkh at linuxfoundation.org>; Anjelique Melendez
> <quic_amelende at quicinc.com>; Dmitry Baryshkov
> <dmitry.baryshkov at linaro.org>; Luca Weiss <luca at z3ntu.xyz>; Bjorn
> Andersson <quic_bjorande at quicinc.com>; linux-pwm at vger.kernel.org;
> linux-gpio at vger.kernel.org; dri-devel at lists.freedesktop.org;
> linux-leds at vger.kernel.org; asahi at lists.linux.dev;
> linux-arm-kernel at lists.infradead.org; linux-rpi-kernel at lists.infradead.org;
> chrome-platform at lists.linux.dev; linux-mips at vger.kernel.org;
> linux-amlogic at lists.infradead.org; linux-riscv at lists.infradead.org;
> linux-mediatek at lists.infradead.org; linux-rockchip at lists.infradead.org;
> linux-samsung-soc at vger.kernel.org;
> linux-stm32 at st-md-mailman.stormreply.com; linux-sunxi at lists.linux.dev;
> linux-tegra at vger.kernel.org; greybus-dev at lists.linaro.org;
> linux-staging at lists.linux.dev
> Subject: [PATCH v2 1/2] pwm: Manage owner assignment implicitly for drivers
> 
> Instead of requiring each driver to care for assigning the owner member of
> struct pwm_ops, handle that implicitly using a macro. Note that the owner
> member has to be moved to struct pwm_chip, as the ops structure usually lives
> in read-only memory and so cannot be modified.
> 
> The upside is that new lowlevel drivers cannot forget the assignment and save
> one line each. The pwm-crc driver didn't assign .owner, that's not a problem in
> practise though as the driver cannot be compiled as a module.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> ---
>  drivers/gpio/gpio-mvebu.c             |  1 -
>  drivers/gpu/drm/bridge/ti-sn65dsi86.c |  1 -
>  drivers/leds/rgb/leds-qcom-lpg.c      |  1 -
>  drivers/pwm/core.c                    | 24
> ++++++++++++++----------
>  drivers/pwm/pwm-ab8500.c              |  1 -
>  drivers/pwm/pwm-apple.c               |  1 -
>  drivers/pwm/pwm-atmel-hlcdc.c         |  1 -
>  drivers/pwm/pwm-atmel-tcb.c           |  1 -
>  drivers/pwm/pwm-atmel.c               |  1 -
>  drivers/pwm/pwm-bcm-iproc.c           |  1 -
>  drivers/pwm/pwm-bcm-kona.c            |  1 -
>  drivers/pwm/pwm-bcm2835.c             |  1 -
>  drivers/pwm/pwm-berlin.c              |  1 -
>  drivers/pwm/pwm-brcmstb.c             |  1 -
>  drivers/pwm/pwm-clk.c                 |  1 -
>  drivers/pwm/pwm-clps711x.c            |  1 -
>  drivers/pwm/pwm-cros-ec.c             |  1 -
>  drivers/pwm/pwm-dwc.c                 |  1 -
>  drivers/pwm/pwm-ep93xx.c              |  1 -
>  drivers/pwm/pwm-fsl-ftm.c             |  1 -
>  drivers/pwm/pwm-hibvt.c               |  1 -
>  drivers/pwm/pwm-img.c                 |  1 -
>  drivers/pwm/pwm-imx-tpm.c             |  1 -
>  drivers/pwm/pwm-imx1.c                |  1 -
>  drivers/pwm/pwm-imx27.c               |  1 -
>  drivers/pwm/pwm-intel-lgm.c           |  1 -
>  drivers/pwm/pwm-iqs620a.c             |  1 -
>  drivers/pwm/pwm-jz4740.c              |  1 -
>  drivers/pwm/pwm-keembay.c             |  1 -
>  drivers/pwm/pwm-lp3943.c              |  1 -
>  drivers/pwm/pwm-lpc18xx-sct.c         |  1 -
>  drivers/pwm/pwm-lpc32xx.c             |  1 -
>  drivers/pwm/pwm-lpss.c                |  1 -
>  drivers/pwm/pwm-mediatek.c            |  1 -
>  drivers/pwm/pwm-meson.c               |  1 -
>  drivers/pwm/pwm-microchip-core.c      |  1 -
>  drivers/pwm/pwm-mtk-disp.c            |  1 -
>  drivers/pwm/pwm-mxs.c                 |  1 -
>  drivers/pwm/pwm-ntxec.c               |  1 -
>  drivers/pwm/pwm-omap-dmtimer.c        |  1 -
>  drivers/pwm/pwm-pca9685.c             |  1 -
>  drivers/pwm/pwm-pxa.c                 |  1 -
>  drivers/pwm/pwm-raspberrypi-poe.c     |  1 -
>  drivers/pwm/pwm-rcar.c                |  1 -
>  drivers/pwm/pwm-renesas-tpu.c         |  1 -
>  drivers/pwm/pwm-rockchip.c            |  1 -
>  drivers/pwm/pwm-rz-mtu3.c             |  1 -
>  drivers/pwm/pwm-samsung.c             |  1 -
>  drivers/pwm/pwm-sifive.c              |  1 -
>  drivers/pwm/pwm-sl28cpld.c            |  1 -
>  drivers/pwm/pwm-spear.c               |  1 -
>  drivers/pwm/pwm-sprd.c                |  1 -
>  drivers/pwm/pwm-sti.c                 |  1 -
>  drivers/pwm/pwm-stm32-lp.c            |  1 -
>  drivers/pwm/pwm-stm32.c               |  1 -
>  drivers/pwm/pwm-stmpe.c               |  1 -
>  drivers/pwm/pwm-sun4i.c               |  1 -
>  drivers/pwm/pwm-sunplus.c             |  1 -
>  drivers/pwm/pwm-tegra.c               |  1 -
>  drivers/pwm/pwm-tiecap.c              |  1 -
>  drivers/pwm/pwm-tiehrpwm.c            |  1 -
>  drivers/pwm/pwm-twl-led.c             |  2 --
>  drivers/pwm/pwm-twl.c                 |  2 --
>  drivers/pwm/pwm-visconti.c            |  1 -

For Visconti:
Acked-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu at toshiba.co.jp >

Best regards,
  Nobuhiro



More information about the dri-devel mailing list