aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pwm (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-04-22pwm: clps71xx: Implement .apply() callbackUwe Kleine-König1-47/+21
To eventually get rid of all legacy drivers convert this driver to the modern world implementing .apply(). This fixes a small issue in clps711x_get_duty() en passant: the multiplication v * 0xf might have overflown. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2022-04-22pwm: raspberrypi-poe: Fix endianness in firmware structUwe Kleine-König1-1/+1
The reg member of struct raspberrypi_pwm_prop is a little endian 32 bit quantity. Explicitly convert the (native endian) value to little endian on assignment as is already done in raspberrypi_pwm_set_property(). This fixes the following sparse warning: drivers/pwm/pwm-raspberrypi-poe.c:69:24: warning: incorrect type in initializer (different base types) drivers/pwm/pwm-raspberrypi-poe.c:69:24: expected restricted __le32 [usertype] reg drivers/pwm/pwm-raspberrypi-poe.c:69:24: got unsigned int [usertype] reg Fixes: 79caa362eab6 ("pwm: Add Raspberry Pi Firmware based PWM bus") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2022-04-22pwm: atmel-tcb: Make atmel_tcb_divisors staticUwe Kleine-König1-1/+1
The array atmel_tcb_divisors is not supposed to be used outside of the driver, so make it static. This fixes a sparse warning: drivers/pwm/pwm-atmel-tcb.c:64:10: warning: symbol 'atmel_tcb_divisors' was not declared. Should it be static? Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2022-04-22pwm: lp3943: Implement .apply() callbackUwe Kleine-König1-7/+34
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> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2022-04-22pwm: lp3943: Fix duty calculation in case period was clampedUwe Kleine-König1-0/+1
The hardware only supports periods <= 1.6 ms and if a bigger period is requested it is clamped to 1.6 ms. In this case duty_cycle might be bigger than 1.6 ms and then the duty cycle register is written with a value bigger than LP3943_MAX_DUTY. So clamp duty_cycle accordingly. Fixes: af66b3c0934e ("pwm: Add LP3943 PWM driver") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2022-04-22pwm: sunplus-pwm: Add Sunplus SoC SP7021 PWM DriverHammer Hsieh3-0/+244
Add Sunplus SoC SP7021 PWM Driver Signed-off-by: Hammer Hsieh <hammerh0314@gmail.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2022-04-22pwm: Add support for Xilinx AXI TimerSean Anderson3-0/+336
This adds PWM support for Xilinx LogiCORE IP AXI soft timers commonly found on Xilinx FPGAs. At the moment clock control is very basic: we just enable the clock during probe and pin the frequency. In the future, someone could add support for disabling the clock when not in use. Some common code has been specially demarcated. While currently only used by the PWM driver, it is anticipated that it may be split off in the future to be used by the timer driver as well. This driver was written with reference to Xilinx DS764 for v1.03.a [1]. [1] https://www.xilinx.com/support/documentation/ip_documentation/axi_timer/v1_03_a/axi_timer_ds764.pdf Signed-off-by: Sean Anderson <sean.anderson@seco.com> Acked-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2022-04-22pwm: atmel-tcb: Drop duplicated tracking of per-channel dataUwe Kleine-König1-6/+6
Per-channel data is tracked using struct pwm_device::chip_data and struct atmel_tcb_pwm_chip::pwms[]. Simplify by using the latter consistently. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2022-04-22pwm-sun4i: Calculate the delay without rounding down to jiffiesMax Kellermann1-3/+1
This fixes a problem that was supposed to be addressed by commit 6eefb79d6f5bc ("pwm: sun4i: Remove erroneous else branch") - backlight could not be switched off on some Allwinner A20. The commit was correct, but was not a reliable fix for the problem, which was timing related. The real problem for the backlight switching problem was that sleeping for a full period did not work, because delay_us is always zero. It is zero because the period (plus 1 microsecond) is rounded down to the next "jiffies", but the period is less than one jiffy. On my Cubieboard 2, the period is 5ms, and 1 jiffy (at the default HZ=100) is 10ms, so nsecs_to_jiffies(10ms+1us)=0. The roundtrip from nanoseconds to jiffies and back to microseconds is an unnecessary loss of precision; always rounding down (via nsecs_to_jiffies()) then causes the breakage. This patch eliminates this roundtrip, and directly converts from nanoseconds to microseconds (for usleep_range()), using DIV_ROUND_UP_ULL() to force rounding up. This way, the sleep time is never zero, and after the sleep, we are guaranteed to be in a different period, and the device is ready for another control command for sure. Signed-off-by: Max Kellermann <max.kellermann@gmail.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2022-04-22pwm-sun4i: Calculate "delay_jiffies" directly, eliminate absolute timeMax Kellermann1-12/+7
Basically this code did "jiffies + period - jiffies", and we can simply eliminate the "jiffies" time stamp here. Signed-off-by: Max Kellermann <max.kellermann@gmail.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2022-04-22pwm-sun4i: Convert "next_period" to local variableMax Kellermann1-5/+4
Its value is calculated in sun4i_pwm_apply() and is used only there. Signed-off-by: Max Kellermann <max.kellermann@gmail.com> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2022-02-24pwm: rcar: Simplify multiplication/shift logicGeert Uytterhoeven1-1/+1
- Remove the superfluous cast; the multiplication will yield a 64-bit result due to the "100ULL" anyway, - "a * (1 << b)" == "a << b". Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2022-02-24pwm: pwm-mediatek: Beautify error messages textAngeloGioacchino Del Regno1-4/+4
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>
2022-02-24pwm: pwm-mediatek: Allocate clk_pwms with devm_kmalloc_arrayAngeloGioacchino Del Regno1-1/+1
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>
2022-02-24pwm: pwm-mediatek: Simplify error handling with dev_err_probe()AngeloGioacchino Del Regno1-19/+11
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>
2022-02-24pwm: brcmstb: Remove useless lockingUwe Kleine-König1-7/+0
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>
2022-02-24pwm: brcmstb: Implement .apply() callbackUwe Kleine-König1-21/+24
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>
2022-02-24pwm: jz4740: Add support for X1000 SoCAidan MacDonald1-0/+5
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>
2022-02-24pwm: vt8500: Rename variable pointing to driver private datazhaoxiao1-19/+19
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>
2022-02-24pwm: pca9685: Reset OFF/ON registers to POR valueLionel Vitte1-2/+2
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>
2022-02-24pwm: atmel: Remove redundant initialization of variable timeoutColin Ian King1-1/+1
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>
2022-02-24pwm: raspberrypi-poe: Drop assignment to struct pwmchip::baseUwe Kleine-König1-1/+0
Since commit f9a8ee8c8bcd ("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>
2022-02-24pwm: bcm-kona: Implement .apply() callbackUwe Kleine-König1-32/+58
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>
2022-02-24pwm: tiehrpwm: Implement .apply() callbackUwe Kleine-König1-5/+35
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>
2022-02-02pwm: pxa: Implement .apply() callbackUwe Kleine-König1-5/+28
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>
2022-02-02pwm: stmpe: Rename variable pointing to driver private dataUwe Kleine-König1-8/+8
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>
2022-02-02pwm: stmpe: Drop unused setting of driver dataUwe Kleine-König1-2/+0
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>
2022-02-02pwm: sun4i: Rename variable pointing to driver private dataUwe Kleine-König1-35/+35
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>
2022-02-02pwm: tegra: Rename variable pointing to driver private dataUwe Kleine-König1-30/+29
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>
2022-02-02pwm: img: Rename variable pointing to driver private dataUwe Kleine-König1-71/+70
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>
2022-02-02pwm: imx1: Implement .apply callbackUwe Kleine-König1-5/+28
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>
2022-02-02pwm: lpc18xx-sct: Simplify driver by not using pwm_[gs]et_chip_data()Uwe Kleine-König1-17/+6
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>
2022-02-02pwm: lpc18xx-sct: Reduce number of devm memory allocationsUwe Kleine-König1-7/+5
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>
2022-02-02pwm: lpc18xx-sct: Initialize driver data and hardware before pwmchip_add()Uwe Kleine-König1-11/+9
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: 841e6f90bb78 ("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>
2022-02-01pwm: meson: Drop always false check from .apply()Uwe Kleine-König1-3/+0
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>
2022-02-01pwm: meson: Simplify duplicated per-channel trackingUwe Kleine-König1-5/+6
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>
2022-02-01pwm: meson: Drop useless check for channel data being NULLUwe Kleine-König1-2/+1
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>
2022-02-01pwm: meson: Drop always false check from .request()Uwe Kleine-König1-7/+1
In .request() pwm_get_chip_data() returns NULL always since commit e926b12c611c ("pwm: Clear chip_data in pwm_put()"). (And if it didn't returning 0 would be wrong because then .request() wouldn't reenable the clk which the other driver code depends on.) 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>
2022-01-20Merge tag 'pwm/for-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwmLinus Torvalds4-82/+211
Pull pwm updates from Thierry Reding: "This contains a number of nice cleanups and improvements for the core and various drivers, as well as a minor tweak to the json-schema device tree bindings" * tag 'pwm/for-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: dt-bindings: pwm: Avoid selecting schema on node name match pwm: img: Use only a single idiom to get a runtime PM reference pwm: vt8500: Implement .apply() callback pwm: img: Implement .apply() callback pwm: twl: Implement .apply() callback pwm: Restore initial state if a legacy callback fails pwm: Prevent a glitch for legacy drivers pwm: Move legacy driver handling into a dedicated function
2022-01-10Merge tag 'drm-next-2022-01-07' of git://anongit.freedesktop.org/drm/drmLinus Torvalds2-15/+27
Pull drm updates from Dave Airlie: "Highlights are support for privacy screens found in new laptops, a bunch of nomodeset refactoring, and i915 enables ADL-P systems by default, while starting to add RPL-S support. vmwgfx adds GEM and support for OpenGL 4.3 features in userspace. Lots of internal refactorings around dma reservations, and lots of driver refactoring as well. Summary: core: - add privacy screen support - move nomodeset option into drm subsystem - clean up nomodeset handling in drivers - make drm_irq.c legacy - fix stack_depot name conflicts - remove DMA_BUF_SET_NAME ioctl restrictions - sysfs: send hotplug event - replace several DRM_* logging macros with drm_* - move hashtable to legacy code - add error return from gem_create_object - cma-helper: improve interfaces, drop CONFIG_DRM_KMS_CMA_HELPER - kernel.h related include cleanups - support XRGB2101010 source buffers ttm: - don't include drm hashtable - stop pruning fences after wait - documentation updates dma-buf: - add dma_resv selftest - add debugfs helpers - remove dma_resv_get_excl_unlocked - documentation - make fences mandatory in dma_resv_add_excl_fence dp: - add link training delay helpers gem: - link shmem/cma helpers into separate modules - use dma_resv iteratior - import dma-buf namespace into gem helper modules scheduler: - fence grab fix - lockdep fixes bridge: - switch to managed MIPI DSI helpers - register and attach during probe fixes - convert to YAML in several places. panel: - add bunch of new panesl simpledrm: - support FB_DAMAGE_CLIPS - support virtual screen sizes - add Apple M1 support amdgpu: - enable seamless boot for DCN 3.01 - runtime PM fixes - use drm_kms_helper_connector_hotplug_event - get all fences at once - use generic drm fb helpers - PSR/DPCD/LTTPR/DSC/PM/RAS/OLED/SRIOV fixes - add smart trace buffer (STB) for supported GPUs - display debugfs entries - new SMU debug option - Documentation update amdkfd: - IP discovery enumeration refactor - interface between driver fixes - SVM fixes - kfd uapi header to define some sysfs bitfields. i915: - support VESA panel backlights - enable ADL-P by default - add eDP privacy screen support - add Raptor Lake S (RPL-S) support - DG2 page table support - lots of GuC/HuC fw refactoring - refactored i915->gt interfaces - CD clock squashing support - enable 10-bit gamma support - update ADL-P DMC fw to v2.14 - enable runtime PM autosuspend by default - ADL-P DSI support - per-lane DP drive settings for ICL+ - add support for pipe C/D DMC firmware - Atomic gamma LUT updates - remove CCS FB stride restrictions on ADL-P - VRR platform support for display 11 - add support for display audio codec keepalive - lots of display refactoring - fix runtime PM handling during PXP suspend - improved eviction performance with async TTM moves - async VMA unbinding improvements - VMA locking refactoring - improved error capture robustness - use per device iommu checks - drop bits stealing from i915_sw_fence function ptr - remove dma_resv_prune - add IC cache invalidation on DG2 nouveau: - crc fixes - validate LUTs in atomic check - set HDMI AVI RGB quant to full tegra: - buffer objects reworks for dma-buf compat - NVDEC driver uAPI support - power management improvements etnaviv: - IOMMU enabled system support - fix > 4GB command buffer mapping - close a DoS vector - fix spurious GPU resets ast: - fix i2c initialization rcar-du: - DSI output support exynos: - replace legacy gpio interface - implement generic GEM object mmap msm: - dpu plane state cleanup in prep for multirect - dpu debugfs cleanups - dp support for sc7280 - a506 support - removal of struct_mutex - remove old eDP sub-driver anx7625: - support MIPI DSI input - support HDMI audio - fix reading EDID lvds: - fix bridge DT bindings megachips: - probe both bridges before registering dw-hdmi: - allow interlace on bridge ps8640: - enable runtime PM - support aux-bus tx358768: - enable reference clock - add pulse mode support ti-sn65dsi86: - use regmap bulk write - add PWM support etnaviv: - get all fences at once gma500: - gem object cleanups kmb: - enable fb console radeon: - use dma_resv_wait_timeout rockchip: - add DSP hold timeout - suspend/resume fixes - PLL clock fixes - implement mmap in GEM object functions - use generic fbdev emulation sun4i: - use CMA helpers without vmap support vc4: - fix HDMI-CEC hang with display is off - power on HDMI controller while disabling - support 4K@60Hz modes - support 10-bit YUV 4:2:0 output vmwgfx: - fix leak on probe errors - fail probing on broken hosts - new placement for MOB page tables - hide internal BOs from userspace - implement GEM support - implement GL 4.3 support virtio: - overflow fixes xen: - implement mmap as GEM object function omapdrm: - fix scatterlist export - support virtual planes mediatek: - MT8192 support - CMDQ refinement" * tag 'drm-next-2022-01-07' of git://anongit.freedesktop.org/drm/drm: (1241 commits) drm/amdgpu: no DC support for headless chips drm/amd/display: fix dereference before NULL check drm/amdgpu: always reset the asic in suspend (v2) drm/amdgpu: put SMU into proper state on runpm suspending for BOCO capable platform drm/amd/display: Fix the uninitialized variable in enable_stream_features() drm/amdgpu: fix runpm documentation amdgpu/pm: Make sysfs pm attributes as read-only for VFs drm/amdgpu: save error count in RAS poison handler drm/amdgpu: drop redundant semicolon drm/amd/display: get and restore link res map drm/amd/display: support dynamic HPO DP link encoder allocation drm/amd/display: access hpo dp link encoder only through link resource drm/amd/display: populate link res in both detection and validation drm/amd/display: define link res and make it accessible to all link interfaces drm/amd/display: 3.2.167 drm/amd/display: [FW Promotion] Release 0.0.98 drm/amd/display: Undo ODM combine drm/amd/display: Add reg defs for DCN303 drm/amd/display: Changed pipe split policy to allow for multi-display pipe split drm/amd/display: Set optimize_pwr_state for DCN31 ...
2021-12-16pwm: tegra: Add runtime PM and OPP supportDmitry Osipenko1-18/+64
The PWM on Tegra belongs to the core power domain and we're going to enable GENPD support for the core domain. Now PWM must be resumed using runtime PM API in order to initialize the PWM power state. The PWM clock rate must be changed using OPP API that will reconfigure the power domain performance state in accordance to the rate. Add runtime PM and OPP support to the PWM driver. Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-11-18Merge drm/drm-next into drm-misc-nextThomas Zimmermann6-31/+43
Backmerging from drm/drm-next for v5.16-rc1. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
2021-11-17pwm: img: Use only a single idiom to get a runtime PM referenceUwe Kleine-König1-4/+2
Currently there are two very similar approaches in use by this driver: img_pwm_config() uses pm_runtime_get_sync() and calls pm_runtime_put_autosuspend() in the error path; img_pwm_enable() calls pm_runtime_resume_and_get() which already puts the reference in its own error path. Align pm_runtime usage and use the same idiom in both locations. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2021-11-17pwm: vt8500: Implement .apply() callbackUwe Kleine-König1-7/+50
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>
2021-11-17pwm: img: Implement .apply() callbackUwe Kleine-König1-3/+26
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> Tested-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2021-11-17pwm: twl: Implement .apply() callbackUwe Kleine-König1-8/+54
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>
2021-11-17pwm: Restore initial state if a legacy callback failsUwe Kleine-König1-6/+8
It is not entirely accurate to go back to the initial state after e.g. .enable() failed, as .config() still modified the hardware, but this same inconsistency exists for drivers that implement .apply(). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2021-11-17pwm: Prevent a glitch for legacy driversUwe Kleine-König1-17/+24
If a running PWM is reconfigured to disabled calling the ->config() callback before disabling the hardware might result in a glitch where the (maybe) new period and duty_cycle are visible on the output before disabling the hardware. So handle disabling before calling ->config(). Also exit early in this case which is possible because period and duty_cycle don't matter for disabled PWMs. In return however ->config has to be called even if state->period == pwm->state.period && state->duty_cycle != pwm->state.duty_cycle because setting these might have been skipped in the previous call. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2021-11-17pwm: Move legacy driver handling into a dedicated functionUwe Kleine-König1-60/+70
There is no change in behaviour, only some code is moved from pwm_apply_state to a separate function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2021-11-05pwm: vt8500: Rename pwm_busy_wait() to make it obviously driver-specificUwe Kleine-König1-8/+8
The pwm_ prefix suggests that pwm_busy_wait() is a function provided by the pwm core. Use the otherwise consistently used driver prefix for this function, too. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>