- 24 Feb, 2022 27 commits
-
-
Krzysztof Kozlowski authored
pwm-cells property is already required by pwm.yaml schema. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Krzysztof Kozlowski authored
pwm-cells property is already required by pwm.yaml schema. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Acked-by:
Vijayakannan Ayyathurai <vijayakannan.ayyathurai@intel.com> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Krzysztof Kozlowski authored
pwm-cells property is already required by pwm.yaml schema. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Acked-by:
Florian Fainelli <f.fainelli@gmail.com> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Krzysztof Kozlowski authored
Include generic pwm.yaml schema, which enforces PWM node naming and brings pwm-cells requirement. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by:
Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Krzysztof Kozlowski authored
Include generic pwm.yaml schema, which enforces PWM node naming and brings pwm-cells requirement. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by:
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Krzysztof Kozlowski authored
Include generic pwm.yaml schema, which enforces PWM node naming and brings pwm-cells requirement. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Krzysztof Kozlowski authored
Include generic pwm.yaml schema, which enforces PWM node naming and brings pwm-cells requirement. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by:
Heiko Stuebner <heiko@sntech.de> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Krzysztof Kozlowski authored
Include generic pwm.yaml schema, which enforces PWM node naming and brings pwm-cells requirement. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Krzysztof Kozlowski authored
Include generic pwm.yaml schema, which enforces PWM node naming and brings pwm-cells requirement. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Acked-by:
Jeff LaBundy <jeff@labundy.com> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Krzysztof Kozlowski authored
Include generic pwm.yaml schema, which enforces PWM node naming and brings pwm-cells requirement. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Krzysztof Kozlowski authored
Include generic pwm.yaml schema, which enforces PWM node naming and brings pwm-cells requirement. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Krzysztof Kozlowski authored
Include generic pwm.yaml schema, which enforces PWM node naming and brings pwm-cells requirement. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Acked-by:
Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
AngeloGioacchino Del Regno authored
As a cherry-on-top cleanup, make error messages clearer to read by changing instances of "clock: XXXX failed" to a more readable "Failed to get XXXX clock". Also add "of" to unsupported period error. This is purely a cosmetic change; no "real" functional changes. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by:
Macpaul Lin <macpaul.lin@mediatek.com> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
AngeloGioacchino Del Regno authored
Switch from devm_kcalloc to devm_kmalloc_array when allocating clk_pwms, as this structure is being filled right after allocating it, hence there is no need to zero it out beforehand. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
AngeloGioacchino Del Regno authored
Use dev_err_probe() to simplify handling errors in pwm_mediatek_probe(). Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Uwe Kleine-König authored
The lock only protects against concurrent users of the PWM API. This is not expected to be necessary. And if there was such an issue, this is better handled in the PWM core instead as it affects all drivers in the same way. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Tested-by:
Florian Fainelli <f.fainelli@gmail.com> Reviewed-by:
Florian Fainelli <f.fainelli@gmail.com> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Uwe Kleine-König authored
To eventually get rid of all legacy drivers convert this driver to the modern world implementing .apply(). Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Tested-by:
Florian Fainelli <f.fainelli@gmail.com> Reviewed-by:
Florian Fainelli <f.fainelli@gmail.com> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Aidan MacDonald authored
The X1000 has the same TCU / PWM hardware as other Ingenic SoCs, but it has only 5 channels. Signed-off-by:
Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
zhaoxiao authored
Status quo is that variables of type struct vt8500_chip * are named "vt8500", "chip". Because usually only struct pwm_device * variables are named "pwm" and "chip" is usually used for variabled of type struct pwm_chip *. So consistently use the same and non-conflicting name "vt8500". Signed-off-by:
zhaoxiao <zhaoxiao@uniontech.com> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Aidan MacDonald authored
The PWM hardware on the X1000 SoC is almost identical to other Ingenic SoCs, so it can be used with only minor driver changes. Signed-off-by:
Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Acked-by:
Rob Herring <robh@kernel.org> Acked-by:
Paul Cercueil <paul@crapouillou.net> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Allen-KH Cheng authored
Add compatible string for MT8183 SoC in device tree binding. Signed-off-by:
Allen-KH Cheng <Allen-KH.Cheng@mediatek.com> Acked-by:
Rob Herring <robh@kernel.org> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Lionel Vitte authored
During the driver probe, registers are not set to their POR value. Signed-off-by:
Lionel Vitte <lionel.vitte@free.fr> Acked-by:
Clemens Gruber <clemens.gruber@pqgruber.com> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Colin Ian King authored
The variable timeout is being initialized with a value that is never read, it is being re-assigned the same value later on. Remove the redundant initialization and keep the latter assignment because it's closer to the use of the variable. Signed-off-by:
Colin Ian King <colin.i.king@gmail.com> Reviewed-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Uwe Kleine-König authored
Since commit f9a8ee8c ("pwm: Always allocate PWM chip base ID dynamically") there is no effect any more for assigning this variable. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by:
Nicolas Saenz Julienne <nsaenz@kernel.org> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Uwe Kleine-König authored
To eventually get rid of all legacy drivers convert this driver to the modern world implementing .apply(). The conversion wasn't quite straight forward because .config() and .enable() were special to effectively swap their usual order. This resulted in calculating the required values twice in some cases when pwm_apply_state() was called. This is optimized en passant, and the order of the callbacks is preserved without special jumping through hoops. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Uwe Kleine-König authored
To eventually get rid of all legacy drivers convert this driver to the modern world implementing .apply(). This just pushes down a slightly optimized variant of how legacy drivers are handled in the core. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Krzysztof Kozlowski authored
Include generic pwm.yaml schema, which enforces PWM node naming. Keep the old name in bindings as deprecated. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by:
Rob Herring <robh@kernel.org> Acked-by:
Lee Jones <lee.jones@linaro.org> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
- 02 Feb, 2022 10 commits
-
-
Uwe Kleine-König authored
To eventually get rid of all legacy drivers convert this driver to the modern world implementing .apply(). This just pushes down a slightly optimized variant of how legacy drivers are handled in the core. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Uwe Kleine-König authored
In all code locations but the probe function variables of type struct stmpe_pwm * are called "stmpe_pwm". Align the name used in stmpe_pwm_probe() accordingly. Still more as the current name "pwm" is usually reserved for variables of type struct pwm_device *. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by:
Linus Walleij <linus.walleij@linaro.org> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Uwe Kleine-König authored
The driver never uses dev_get_drvdata() to retrieve the pwm driver data. So drop setting it. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Uwe Kleine-König authored
Status quo is that variables of type struct sun4i_pwm_chip * are named "pwm". This name is usually reserved for variabled of type struct pwm_chip *. So consistently use the same and non-conflicting name "sun4ichip" which better reflects the intend Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Uwe Kleine-König authored
Status quo is that variables of type struct tegra_pwm_chip * are named "pwm", "chip" or "pc". The two formers are all not optimal because usually only struct pwm_device * variables are named "pwm" and "chip" is usually used for variabled of type struct pwm_chip *. So consistently use the same and non-conflicting name "pc". Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Uwe Kleine-König authored
Status quo is that variables of type struct img_pwm_chip * are named "pwm_chip", "pwm" or "chip" which are all not optimal because there is a struct pwm_chip in the core, usually only struct pwm_device * variables are named "pwm" and "chip" is usually used for variabled of type struct pwm_chip *. So consistently use the same and non-conflicting name "imgchip". Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Uwe Kleine-König authored
To eventually get rid of all legacy drivers convert this driver to the modern world implementing .apply(). This just pushes down a slightly optimized variant of how legacy drivers are handled in the core. As a side effect this improves the behaviour for big duty cycles where max * duty_ns overflowed before. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Uwe Kleine-König authored
The per-channel data is available directly in the driver data struct. So use it without making use of pwm_[gs]et_chip_data(). The relevant change introduced by this patch to lpc18xx_pwm_disable() at the assembler level (for an arm lpc18xx_defconfig build) is: push {r3, r4, r5, lr} mov r4, r0 mov r0, r1 mov r5, r1 bl 0 <pwm_get_chip_data> ldr r3, [r0, #0] changes to ldr r3, [r1, #8] push {r4, lr} add.w r3, r0, r3, lsl #2 ldr r3, [r3, #92] ; 0x5c So this reduces stack usage, has an improved runtime behavior because of better pipeline usage, doesn't branch to an external function and the generated code is a bit smaller occupying less memory. The codesize of lpc18xx_pwm_probe() is reduced by 32 bytes. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Uwe Kleine-König authored
Each devm allocations has an overhead of 24 bytes to store the related struct devres_node additionally to the fragmentation of the allocator. So allocating 16 struct lpc18xx_pwm_data (which only hold a single int) adds quite some overhead. Instead put the per-channel data into the driver data struct and allocate it in one go. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Uwe Kleine-König authored
When a driver calls pwmchip_add() it has to be prepared to immediately get its callbacks called. So move allocation of driver data and hardware initialization before the call to pwmchip_add(). This fixes a potential NULL pointer exception and a race condition on register writes. Fixes: 841e6f90 ("pwm: NXP LPC18xx PWM/SCT driver") Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
- 01 Feb, 2022 3 commits
-
-
Uwe Kleine-König authored
The PWM core only calls the apply callback with a valid state pointer, so don't repeat this check already done in the core. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by:
Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Uwe Kleine-König authored
The driver tracks per-channel data via struct pwm_device::chip_data and struct meson_pwm::channels[]. The latter holds the actual data, the former is only a pointer to the latter. So simplify by using struct meson_pwm::channels[] consistently. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by:
Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-
Uwe Kleine-König authored
In meson_pwm_free() the function pwm_get_chip_data() always returns a non-NULL pointer because it's only called when the request callback succeeded and this callback calls pwm_set_chip_data() in this case. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by:
Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by:
Thierry Reding <thierry.reding@gmail.com>
-