MikroBUS is an open standard developed by MikroElektronika for connecting
add-on boards to microcontrollers or microprocessors. It essentially
allows you to easily expand the functionality of your main boards using
these add-on boards.
This patchset adds mikroBUS as a Linux bus type and provides a driver to
parse, and flash mikroBUS manifest and register the mikroBUS board.
The v1 and v2 of this patchset was submitted by Vaishnav M A back in
2020. This patchset also includes changes made over the years as part of
BeagleBoards kernel.
Link: https://www.mikroe.com/mikrobus
Link: https://docs.beagleboard.org/latest/boards/beagleplay/
Link: https://lore.kernel.org/lkml/20200818124815.11029-1-vaishnav@beagleboard.or… Patch v2
Changes in v3:
- Use phandle instead of busname for spi
- Use spi board info for registering new device
- Convert dt bindings to yaml
- Add support for clickID
- Code cleanup and style changes
- Additions required to spi, serdev, w1 and regulator subsystems
Changes in v2:
- support for adding mikroBUS ports from DT overlays,
- remove debug sysFS interface for adding mikrobus ports,
- consider extended pin usage/deviations from mikrobus standard
specifications
- use greybus CPort protocol enum instead of new protocol enums
- Fix cases of wrong indentation, ignoring return values, freeing allocated
resources in case of errors and other style suggestions in v1 review.
Ayush Singh (7):
dt-bindings: misc: Add mikrobus-connector
w1: Add w1_find_master_device
spi: Make of_find_spi_controller_by_node() available
regulator: fixed-helper: export regulator_register_always_on
greybus: Add mikroBUS manifest types
mikrobus: Add mikrobus driver
dts: ti: k3-am625-beagleplay: Add mikroBUS
Vaishnav M A (1):
serdev: add of_ helper to get serdev controller
.../bindings/misc/mikrobus-connector.yaml | 110 ++
MAINTAINERS | 7 +
.../arm64/boot/dts/ti/k3-am625-beagleplay.dts | 76 +-
drivers/misc/Kconfig | 1 +
drivers/misc/Makefile | 1 +
drivers/misc/mikrobus/Kconfig | 19 +
drivers/misc/mikrobus/Makefile | 6 +
drivers/misc/mikrobus/mikrobus_core.c | 942 ++++++++++++++++++
drivers/misc/mikrobus/mikrobus_core.h | 201 ++++
drivers/misc/mikrobus/mikrobus_id.c | 229 +++++
drivers/misc/mikrobus/mikrobus_manifest.c | 502 ++++++++++
drivers/misc/mikrobus/mikrobus_manifest.h | 20 +
drivers/regulator/fixed-helper.c | 1 +
drivers/spi/spi.c | 206 ++--
drivers/tty/serdev/core.c | 19 +
drivers/w1/w1.c | 6 +-
drivers/w1/w1_int.c | 27 +
include/linux/greybus/greybus_manifest.h | 49 +
include/linux/serdev.h | 4 +
include/linux/spi/spi.h | 4 +
include/linux/w1.h | 1 +
21 files changed, 2318 insertions(+), 113 deletions(-)
create mode 100644 Documentation/devicetree/bindings/misc/mikrobus-connector.yaml
create mode 100644 drivers/misc/mikrobus/Kconfig
create mode 100644 drivers/misc/mikrobus/Makefile
create mode 100644 drivers/misc/mikrobus/mikrobus_core.c
create mode 100644 drivers/misc/mikrobus/mikrobus_core.h
create mode 100644 drivers/misc/mikrobus/mikrobus_id.c
create mode 100644 drivers/misc/mikrobus/mikrobus_manifest.c
create mode 100644 drivers/misc/mikrobus/mikrobus_manifest.h
base-commit: 61996c073c9b070922ad3a36c981ca6ddbea19a5
--
2.44.0
If channel for the given node is not found we return null from
get_channel_from_mode. Make sure we validate the return pointer
before using it in two of the missing places.
This was originally reported in [0]:
Found by Linux Verification Center (linuxtesting.org) with SVACE.
[0] https://lore.kernel.org/all/20240301190425.120605-1-m.lobanov@rosalinux.ru
Fixes: 2870b52bae4c ("greybus: lights: add lights implementation")
Reported-by: Mikhail Lobanov <m.lobanov(a)rosalinux.ru>
Suggested-by: Mikhail Lobanov <m.lobanov(a)rosalinux.ru>
Suggested-by: Alex Elder <elder(a)ieee.org>
Signed-off-by: Rui Miguel Silva <rmfrfs(a)gmail.com>
---
v1[1] -> v2:
GregKh:
- remove overkill WARN_ON and replace it for a dev_err
[1]: https://lore.kernel.org/all/20240307094838.688281-1-rmfrfs@gmail.com/
drivers/staging/greybus/light.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c
index c6bd86a5335a..9999f8401699 100644
--- a/drivers/staging/greybus/light.c
+++ b/drivers/staging/greybus/light.c
@@ -147,6 +147,9 @@ static int __gb_lights_flash_brightness_set(struct gb_channel *channel)
channel = get_channel_from_mode(channel->light,
GB_CHANNEL_MODE_TORCH);
+ if (!channel)
+ return -EINVAL;
+
/* For not flash we need to convert brightness to intensity */
intensity = channel->intensity_uA.min +
(channel->intensity_uA.step * channel->led->brightness);
@@ -549,7 +552,10 @@ static int gb_lights_light_v4l2_register(struct gb_light *light)
}
channel_flash = get_channel_from_mode(light, GB_CHANNEL_MODE_FLASH);
- WARN_ON(!channel_flash);
+ if (!channel_flash) {
+ dev_err(dev, "failed to get flash channel from mode\n");
+ return -EINVAL;
+ }
fled = &channel_flash->fled;
--
2.44.0
If channel for the given node is not found we return null from
get_channel_from_mode. Make sure we validate the return pointer
before using it in two of the missing places.
This was originally reported in [0]:
Found by Linux Verification Center (linuxtesting.org) with SVACE.
[0] https://lore.kernel.org/all/20240301190425.120605-1-m.lobanov@rosalinux.ru
Fixes: 2870b52bae4c ("greybus: lights: add lights implementation")
Reported-by: Mikhail Lobanov <m.lobanov(a)rosalinux.ru>
Suggested-by: Mikhail Lobanov <m.lobanov(a)rosalinux.ru>
Suggested-by: Alex Elder <elder(a)ieee.org>
Signed-off-by: Rui Miguel Silva <rmfrfs(a)gmail.com>
---
drivers/staging/greybus/light.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c
index c6bd86a5335a..6f10b9e2c053 100644
--- a/drivers/staging/greybus/light.c
+++ b/drivers/staging/greybus/light.c
@@ -147,6 +147,9 @@ static int __gb_lights_flash_brightness_set(struct gb_channel *channel)
channel = get_channel_from_mode(channel->light,
GB_CHANNEL_MODE_TORCH);
+ if (!channel)
+ return -EINVAL;
+
/* For not flash we need to convert brightness to intensity */
intensity = channel->intensity_uA.min +
(channel->intensity_uA.step * channel->led->brightness);
@@ -549,7 +552,8 @@ static int gb_lights_light_v4l2_register(struct gb_light *light)
}
channel_flash = get_channel_from_mode(light, GB_CHANNEL_MODE_FLASH);
- WARN_ON(!channel_flash);
+ if (WARN_ON(!channel_flash))
+ return -EINVAL;
fled = &channel_flash->fled;
--
2.44.0
Hello,
this is v6 of the series introducing better lifetime tracking for
pwmchips that addresses (for now theoretic) lifetime issues of pwm
chips. Addressing these is a necessary precondition to introduce chardev
support for PWMs.
Locking got more complicated due to non-sleeping chips, so I dropped
the character device patch because it got still more incomplete now.
Also I'm not yet entirely sure about patches #162 and #163 and I expect
them to change before they can go in. My plan for the next merge window
is to get the patches in up to #160. After that the addition of chardev
support (including correct locking) can continue without having to touch
the lowlevel driver. So the idea of this series is to get the driver
adaptions out of the way as this requires some cross-tree coordination.
The patches that touch files outside of drivers/pwm include:
- gpio: mvebu: Make use of devm_pwmchip_alloc() function
It already has an Ack by Linus Walleij.
- drm/bridge: ti-sn65dsi86: Make use of pwmchip_parent() accessor
- drm/bridge: ti-sn65dsi86: Make use of devm_pwmchip_alloc() function
The 2nd already has an Ack by Douglas Anderson which I tend to assume
good enough to merge this via my pwm tree, too. An Ack for the first
patch would be nice.
- leds: qcom-lpg: Make use of devm_pwmchip_alloc() function
Already has an Ack by Lee Jones.
- staging: greybus: pwm: Change prototype of helpers to prepare further changes
- staging: greybus: pwm: Make use of pwmchip_parent() accessor
- staging: greybus: pwm: Rely on pwm framework to pass a valid hwpwm
- staging: greybus: pwm: Drop unused gb_connection_set_data()
- staging: greybus: pwm: Rework how the number of PWM lines is determined
- staging: greybus: pwm: Make use of devm_pwmchip_alloc() function
The greybus patches already got an Ack by Greg Kroah-Hartman in an
earlier series, but I dropped it as the patches changed considerably.
For the patches that already have an Ack by the respective maintainers
I'll assume this is good enough to merge the patches via the pwm tree.
Please object if you don't agree. For the others an Ack with that
semantic would be nice. If you want to merge via your tree, that would
need some coordination. The adaptions depend on patches #1 - #3, so this
would involve an immutable branch or waiting until these patches reached
your tree via the mainline tree. The series rebases fine on today's
next, so at least for now there are no conflicts that git cannot resolve
automatically.
The biggest changes compared to v5 are:
- Make pwmchip_parent's parameter const
- Use pwmchip_parent also in drivers/pwm/sysfs.c and drivers/pwm/core.c
- Several bug fixes in the conversions I found during the rework
- Provide a non-devm pwmchip_alloc() function earlier (for the greybus
pwm driver)
- Increase alignment of driver private data to ARCH_DMA_MINALIGN bytes
- Split several patches to make the easier reviewable
The series is available via git at
https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm-lifetime-tracking
if you want to give it a test. I'll keep this branch updated for the
feedback I get here.
Best regards
Uwe
Uwe Kleine-König (164):
pwm: Provide an inline function to get the parent device of a given
chip
pwm: Provide wrappers for storing and getting driver private data
pwm: Provide pwmchip_alloc() function and a devm variant of it
pwm: ab8500: Make use of pwmchip_parent() accessor
pwm: ab8500: Introduce a local pwm_chip variable in .probe()
pwm: ab8500: Make use of devm_pwmchip_alloc() function
pwm: apple: Make use of devm_pwmchip_alloc() function
pwm: atmel: Change prototype of a helper to prepare further changes
pwm: atmel: Make use of pwmchip_parent() accessor
pwm: atmel: Make use of devm_pwmchip_alloc() function
pwm: atmel-hlcdc: Prepare removing pwm_chip from driver data
pwm: atmel-hlcdc: Make use of devm_pwmchip_alloc() function
pwm: atmel-tcb: Make use of pwmchip_parent() accessor
pwm: atmel-tcb: Prepare removing pwm_chip from driver data
pwm: atmel-tcb: Make use of devm_pwmchip_alloc() function
pwm: bcm2835: Make use of devm_pwmchip_alloc() function
pwm: bcm-iproc: Make use of devm_pwmchip_alloc() function
pwm: bcm-kona: Make use of pwmchip_parent() accessor
pwm: bcm-kona: Make use of devm_pwmchip_alloc() function
pwm: berlin: Prepare removing pwm_chip from driver data
pwm: berlin: Make use of devm_pwmchip_alloc() function
pwm: brcmstb: Make use of devm_pwmchip_alloc() function
pwm: clk: Prepare removing pwm_chip from driver data
pwm: clk: Make use of devm_pwmchip_alloc() function
pwm: clps711x: Make use of devm_pwmchip_alloc() function
pwm: crc: Simplify code to determine the pwmchip's parent device
pwm: crc: Make use of pwmchip_parent() accessor
pwm: crc: Make use of devm_pwmchip_alloc() function
pwm: cros-ec: Change prototype of helpers to prepare further changes
pwm: cros-ec: Make use of pwmchip_parent() accessor
pwm: cros-ec: Make use of devm_pwmchip_alloc() function
pwm: dwc: Prepare removing pwm_chip from driver data
pwm: dwc: Make use of devm_pwmchip_alloc() function
pwm: dwc-core: Make use of pwmchip_parent() accessor
pwm: ep93xx: Make use of pwmchip_parent() accessor
pwm: ep93xx: Make use of devm_pwmchip_alloc() function
pwm: fsl-ftm: Change prototype of a helper to prepare further changes
pwm: fsl-ftm: Make use of pwmchip_parent() accessor
pwm: fsl-ftm: Prepare removing pwm_chip from driver data
pwm: fsl-ftm: Make use of devm_pwmchip_alloc() function
pwm: hibvt: Consistently name driver data hi_pwm_chip
pwm: hibvt: Make use of devm_pwmchip_alloc() function
pwm: img: Drop write-only variable from driver private data
pwm: img: Make use of pwmchip_parent() accessor
pwm: img: Prepare removing pwm_chip from driver data
pwm: img: Make use of devm_pwmchip_alloc() function
pwm: imx1: Make use of devm_pwmchip_alloc() function
pwm: imx27: Make use of pwmchip_parent() accessor
pwm: imx27: Make use of devm_pwmchip_alloc() function
pwm: imx-tpm: Make use of devm_pwmchip_alloc() function
pwm: intel-lgm: Make use of devm_pwmchip_alloc() function
pwm: iqs620a: Create a wrapper for converting a pwm_chip to driver
data
pwm: iqs620a: Prepare removing pwm_chip from driver data
pwm: iqs620a: Make use of devm_pwmchip_alloc() function
pwm: jz4740: Change prototype of a helper to prepare further changes
pwm: jz4740: Make use of pwmchip_parent() accessor
pwm: jz4740: Make use of devm_pwmchip_alloc() function
pwm: keembay: Make use of devm_pwmchip_alloc() function
pwm: lp3943: Make use of devm_pwmchip_alloc() function
pwm: lpc18xx-sct: Drop hardly used member from driver private data
pwm: lpc18xx-sct: Make use of pwmchip_parent() accessor
pwm: lpc18xx-sct: Prepare removing pwm_chip from driver data
pwm: lpc18xx-sct: Make use of devm_pwmchip_alloc() function
pwm: lpc32xx: Make use of devm_pwmchip_alloc() function
pwm: lpss: Make use of pwmchip_parent() accessor
pwm: lpss: Don't set driver data
pwm: lpss-*: Make use of devm_pwmchip_alloc() function
pwm: mediatek: Make use of pwmchip_parent() accessor
pwm: mediatek: Make use of devm_pwmchip_alloc() function
pwm: meson: Change prototype of a few helpers to prepare further
changes
pwm: meson: Make use of pwmchip_parent() accessor
pwm: meson: Make use of devm_pwmchip_alloc() function
pwm: microchip-core: Make use of devm_pwmchip_alloc() function
pwm: mtk-disp: Make use of pwmchip_parent() accessor
pwm: mtk-disp: Make use of devm_pwmchip_alloc() function
pwm: mxs: Make use of devm_pwmchip_alloc() function
pwm: ntxec: Make use of devm_pwmchip_alloc() function
pwm: omap-dmtimer: Make use of pwmchip_parent() accessor
pwm: omap-dmtimer: Prepare removing pwm_chip from driver data
pwm: omap-dmtimer: Make use of devm_pwmchip_alloc() function
pwm: pca9685: Prepare removing pwm_chip from driver data
pwm: pca9685: Make use of pwmchip_parent() accessor
pwm: pca9685: Make use of devm_pwmchip_alloc() function
pwm: pxa: Make use of devm_pwmchip_alloc() function
pwm: raspberrypi-poe: Make use of pwmchip_parent() accessor
pwm: raspberrypi-poe: Make use of devm_pwmchip_alloc() function
pwm: rcar: Make use of pwmchip_parent() accessor
pwm: rcar: Prepare removing pwm_chip from driver data
pwm: rcar: Make use of devm_pwmchip_alloc() function
pwm: renesas-tpu: Make use of devm_pwmchip_alloc() function
pwm: rochchip: Prepare removing pwm_chip from driver data
pwm: rockchip: Make use of devm_pwmchip_alloc() function
pwm: rz-mtu3: Make use of pwmchip_parent() accessor
pwm: rz-mtu3: Prepare removing pwm_chip from driver data
pwm: rz-mtu3: Make use of devm_pwmchip_alloc() function
pwm: samsung: Simplify code to determine the pwmchip's parent device
pwm: samsung: Change prototype of helpers to prepare further changes
pwm: samsung: Make use of pwmchip_parent() accessor
pwm: samsung: Simplify by using devm functions in probe
pwm: samsung: Simplify using dev_err_probe()
pwm: samsung: Make use of devm_pwmchip_alloc() function
pwm: sifive: Simplify code to determine the pwmchip's parent device
pwm: sifive: Prepare removing pwm_chip from driver data
pwm: sifive: Make use of pwmchip_parent() accessor
pwm: sifive: Make use of devm_pwmchip_alloc() function
pwm: sl28cpld: Make use of devm_pwmchip_alloc() function
pwm: spear: Make use of devm_pwmchip_alloc() function
pwm: sprd: Rework how the available channels are counted
pwm: sprd: Drop duplicated tracking of the parent device
pwm: sprd: Make use of devm_pwmchip_alloc() function
pwm: sti: Prepare removing pwm_chip from driver data
pwm: sti: Make use of devm_pwmchip_alloc() function
pwm: stm32: Simplify code to determine the pwmchip's parent device
pwm: stm32: Change prototype of a helper to prepare further changes
pwm: stm32: Prepare removing pwm_chip from driver data
pwm: stm32: Change prototype of helper that detects npwm to prepare
further changes
pwm: stm32: Make use of devm_pwmchip_alloc() function
pwm: stm32-lp: Simplify code to determine the pwmchip's parent device
pwm: stm32-lp: Prepare removing pwm_chip from driver data
pwm: stm32-lp: Make use of pwmchip_parent() accessor
pwm: stm32-lp: Make use of devm_pwmchip_alloc() function
pwm: stmpe: Make use of pwmchip_parent() accessor
pwm: stmpe: Make use of devm_pwmchip_alloc() function
pwm: sun4i: Make use of pwmchip_parent() accessor
pwm: sun4i: Prepare removing pwm_chip from driver data
pwm: sun4i: Consistently name driver data sun4ichip
pwm: sun4i: Make use of devm_pwmchip_alloc() function
pwm: sunplus: Make use of devm_pwmchip_alloc() function
pwm: tegra: Drop duplicated tracking of the parent device
pwm: tegra: Prepare removing pwm_chip from driver data
pwm: tegra: Make use of devm_pwmchip_alloc() function
pwm: tiecap: Simplify code to determine the pwmchip's parent device
pwm: tiecap: Change prototype of helpers to prepare further changes
pwm: tiecap: Make use of pwmchip_parent() accessor
pwm: tiecap: Make use of devm_pwmchip_alloc() function
pwm: tiehrpwm: Simplify code to determine the pwmchip's parent device
pwm: tiehrpwm: Change prototype of helpers to prepare further changes
pwm: tiehrpwm: Make use of pwmchip_parent() accessor
pwm: tiehrpwm: Make use of devm_pwmchip_alloc() function
pwm: twl: Make use of pwmchip_parent() accessor
pwm: twl: Make use of devm_pwmchip_alloc() function
pwm: twl-led: Make use of pwmchip_parent() accessor
pwm: twl-led: Make use of devm_pwmchip_alloc() function
pwm: visconti: Make use of devm_pwmchip_alloc() function
pwm: vt8500: Change prototype of a helper to prepare further changes
pwm: vt8500: Introduce a local pwm_chip variable in .probe()
pwm: vt8500: Make use of pwmchip_parent() accessor
pwm: vt8500: Make use of devm_pwmchip_alloc() function
pwm: xilinx: Prepare removing pwm_chip from driver data
pwm: xilinx: Make use of devm_pwmchip_alloc() function
gpio: mvebu: Make use of devm_pwmchip_alloc() function
drm/bridge: ti-sn65dsi86: Make use of pwmchip_parent() accessor
drm/bridge: ti-sn65dsi86: Make use of devm_pwmchip_alloc() function
leds: qcom-lpg: Make use of devm_pwmchip_alloc() function
staging: greybus: pwm: Change prototype of helpers to prepare further
changes
staging: greybus: pwm: Make use of pwmchip_parent() accessor
staging: greybus: pwm: Rely on pwm framework to pass a valid hwpwm
staging: greybus: pwm: Drop unused gb_connection_set_data()
staging: greybus: pwm: Rework how the number of PWM lines is
determined
staging: greybus: pwm: Make use of devm_pwmchip_alloc() function
pwm: Ensure that pwm_chips are allocated using pwmchip_alloc()
pwm: Ensure a struct pwm has the same lifetime as its pwm_chip
pwm: Ensure the memory backing a PWM chip isn't freed while used
pwm: Make pwmchip_[sg]et_drvdata() a wrapper around dev_set_drvdata()
.../driver-api/driver-model/devres.rst | 1 +
Documentation/driver-api/pwm.rst | 11 +-
drivers/gpio/gpio-mvebu.c | 18 +-
drivers/gpu/drm/bridge/ti-sn65dsi86.c | 31 +--
drivers/leds/rgb/leds-qcom-lpg.c | 16 +-
drivers/pinctrl/intel/pinctrl-intel.c | 6 +-
drivers/pwm/Kconfig | 4 -
drivers/pwm/Makefile | 3 +-
drivers/pwm/core.c | 184 +++++++++++++-----
drivers/pwm/pwm-ab8500.c | 36 ++--
drivers/pwm/pwm-apple.c | 18 +-
drivers/pwm/pwm-atmel-hlcdc.c | 37 ++--
drivers/pwm/pwm-atmel-tcb.c | 32 +--
drivers/pwm/pwm-atmel.c | 34 ++--
drivers/pwm/pwm-bcm-iproc.c | 19 +-
drivers/pwm/pwm-bcm-kona.c | 23 ++-
drivers/pwm/pwm-bcm2835.c | 19 +-
drivers/pwm/pwm-berlin.c | 29 +--
drivers/pwm/pwm-brcmstb.c | 17 +-
drivers/pwm/pwm-clk.c | 27 +--
drivers/pwm/pwm-clps711x.c | 17 +-
drivers/pwm/pwm-crc.c | 22 +--
drivers/pwm/pwm-cros-ec.c | 58 +++---
drivers/pwm/pwm-dwc-core.c | 26 +--
drivers/pwm/pwm-dwc.c | 17 +-
drivers/pwm/pwm-dwc.h | 9 +-
drivers/pwm/pwm-ep93xx.c | 21 +-
drivers/pwm/pwm-fsl-ftm.c | 49 ++---
drivers/pwm/pwm-hibvt.c | 70 ++++---
drivers/pwm/pwm-img.c | 60 +++---
drivers/pwm/pwm-imx-tpm.c | 34 ++--
drivers/pwm/pwm-imx1.c | 20 +-
drivers/pwm/pwm-imx27.c | 26 +--
drivers/pwm/pwm-intel-lgm.c | 17 +-
drivers/pwm/pwm-iqs620a.c | 30 +--
drivers/pwm/pwm-jz4740.c | 36 ++--
drivers/pwm/pwm-keembay.c | 17 +-
drivers/pwm/pwm-lp3943.c | 17 +-
drivers/pwm/pwm-lpc18xx-sct.c | 34 ++--
drivers/pwm/pwm-lpc32xx.c | 21 +-
drivers/pwm/pwm-lpss-pci.c | 10 +-
drivers/pwm/pwm-lpss-platform.c | 10 +-
drivers/pwm/pwm-lpss.c | 34 ++--
drivers/pwm/pwm-lpss.h | 1 -
drivers/pwm/pwm-mediatek.c | 29 +--
drivers/pwm/pwm-meson.c | 57 +++---
drivers/pwm/pwm-microchip-core.c | 17 +-
drivers/pwm/pwm-mtk-disp.c | 25 ++-
drivers/pwm/pwm-mxs.c | 32 +--
drivers/pwm/pwm-ntxec.c | 14 +-
drivers/pwm/pwm-omap-dmtimer.c | 47 +++--
drivers/pwm/pwm-pca9685.c | 161 +++++++--------
drivers/pwm/pwm-pxa.c | 21 +-
drivers/pwm/pwm-raspberrypi-poe.c | 20 +-
drivers/pwm/pwm-rcar.c | 27 ++-
drivers/pwm/pwm-renesas-tpu.c | 20 +-
drivers/pwm/pwm-rockchip.c | 24 +--
drivers/pwm/pwm-rz-mtu3.c | 60 +++---
drivers/pwm/pwm-samsung.c | 94 ++++-----
drivers/pwm/pwm-sifive.c | 30 +--
drivers/pwm/pwm-sl28cpld.c | 13 +-
drivers/pwm/pwm-spear.c | 18 +-
drivers/pwm/pwm-sprd.c | 58 +++---
drivers/pwm/pwm-sti.c | 61 +++---
drivers/pwm/pwm-stm32-lp.c | 31 ++-
drivers/pwm/pwm-stm32.c | 56 +++---
drivers/pwm/pwm-stmpe.c | 58 +++---
drivers/pwm/pwm-sun4i.c | 100 +++++-----
drivers/pwm/pwm-sunplus.c | 17 +-
drivers/pwm/pwm-tegra.c | 50 ++---
drivers/pwm/pwm-tiecap.c | 55 +++---
drivers/pwm/pwm-tiehrpwm.c | 72 +++----
drivers/pwm/pwm-twl-led.c | 55 +++---
drivers/pwm/pwm-twl.c | 50 +++--
drivers/pwm/pwm-visconti.c | 17 +-
drivers/pwm/pwm-vt8500.c | 43 ++--
drivers/pwm/pwm-xilinx.c | 34 ++--
drivers/pwm/sysfs.c | 45 +----
drivers/staging/greybus/pwm.c | 133 ++++++-------
include/linux/platform_data/x86/pwm-lpss.h | 4 +-
include/linux/pwm.h | 56 ++++--
81 files changed, 1502 insertions(+), 1423 deletions(-)
base-commit: ab105bfee27776dd946f8003d1e895fbf7674a3f
--
2.43.0
Changes since v2
(https://lore.kernel.org/linux-spi/cover.1705944943.git.u.kleine-koenig@peng…):
- Drop patch "mtd: rawnand: fsl_elbc: Let .probe retry if local bus is
missing" which doesn't belong into this series.
- Fix a build failure noticed by the kernel build bot in
drivers/spi/spi-au1550.c. (I failed to catch this because this driver
is mips only, but not enabled in a mips allmodconfig. That's a bit
unfortunate, but not easily fixable.)
- Add the Reviewed-by: and Acked-by: tags I received for v2.
Mark already announced for v2 that he is willing to apply the whole
series to his spi tree. Assuming no other show stoper are found in this
v3, I assume that's the plan still for this series now.
Thanks
Uwe
Uwe Kleine-König (32):
fpga: ice40-spi: Follow renaming of SPI "master" to "controller"
ieee802154: ca8210: Follow renaming of SPI "master" to "controller"
iio: adc: ad_sigma_delta: Follow renaming of SPI "master" to "controller"
Input: pxspad - follow renaming of SPI "master" to "controller"
Input: synaptics-rmi4 - follow renaming of SPI "master" to "controller"
media: mgb4: Follow renaming of SPI "master" to "controller"
media: netup_unidvb: Follow renaming of SPI "master" to "controller"
media: usb/msi2500: Follow renaming of SPI "master" to "controller"
media: v4l2-subdev: Follow renaming of SPI "master" to "controller"
misc: gehc-achc: Follow renaming of SPI "master" to "controller"
mmc: mmc_spi: Follow renaming of SPI "master" to "controller"
mtd: dataflash: Follow renaming of SPI "master" to "controller"
net: ks8851: Follow renaming of SPI "master" to "controller"
net: vertexcom: mse102x: Follow renaming of SPI "master" to "controller"
platform/chrome: cros_ec_spi: Follow renaming of SPI "master" to "controller"
spi: bitbang: Follow renaming of SPI "master" to "controller"
spi: cadence-quadspi: Don't emit error message on allocation error
spi: cadence-quadspi: Follow renaming of SPI "master" to "controller"
spi: cavium: Follow renaming of SPI "master" to "controller"
spi: geni-qcom: Follow renaming of SPI "master" to "controller"
spi: loopback-test: Follow renaming of SPI "master" to "controller"
spi: slave-mt27xx: Follow renaming of SPI "master" to "controller"
spi: spidev: Follow renaming of SPI "master" to "controller"
staging: fbtft: Follow renaming of SPI "master" to "controller"
staging: greybus: spi: Follow renaming of SPI "master" to "controller"
tpm_tis_spi: Follow renaming of SPI "master" to "controller"
usb: gadget: max3420_udc: Follow renaming of SPI "master" to "controller"
video: fbdev: mmp: Follow renaming of SPI "master" to "controller"
wifi: libertas: Follow renaming of SPI "master" to "controller"
spi: fsl-lib: Follow renaming of SPI "master" to "controller"
spi: Drop compat layer from renaming "master" to "controller"
Documentation: spi: Update documentation for renaming "master" to "controller"
.../driver-api/driver-model/devres.rst | 2 +-
Documentation/spi/spi-summary.rst | 74 +++++++++----------
drivers/char/tpm/tpm_tis_spi_main.c | 4 +-
drivers/fpga/ice40-spi.c | 4 +-
drivers/iio/adc/ad_sigma_delta.c | 14 ++--
drivers/input/joystick/psxpad-spi.c | 4 +-
drivers/input/rmi4/rmi_spi.c | 2 +-
drivers/media/pci/mgb4/mgb4_core.c | 14 ++--
.../media/pci/netup_unidvb/netup_unidvb_spi.c | 48 ++++++------
drivers/media/usb/msi2500/msi2500.c | 38 +++++-----
drivers/media/v4l2-core/v4l2-spi.c | 4 +-
drivers/misc/gehc-achc.c | 8 +-
drivers/mmc/host/mmc_spi.c | 6 +-
drivers/mtd/devices/mtd_dataflash.c | 2 +-
drivers/net/ethernet/micrel/ks8851_spi.c | 4 +-
drivers/net/ethernet/vertexcom/mse102x.c | 2 +-
drivers/net/ieee802154/ca8210.c | 2 +-
.../net/wireless/marvell/libertas/if_spi.c | 2 +-
drivers/platform/chrome/cros_ec_spi.c | 8 +-
drivers/spi/spi-ath79.c | 4 +-
drivers/spi/spi-au1550.c | 2 +-
drivers/spi/spi-bitbang.c | 64 ++++++++--------
drivers/spi/spi-butterfly.c | 6 +-
drivers/spi/spi-cadence-quadspi.c | 7 +-
drivers/spi/spi-cavium.c | 6 +-
drivers/spi/spi-cavium.h | 2 +-
drivers/spi/spi-davinci.c | 6 +-
drivers/spi/spi-fsl-lib.c | 14 ++--
drivers/spi/spi-geni-qcom.c | 2 +-
drivers/spi/spi-gpio.c | 2 +-
drivers/spi/spi-lm70llp.c | 6 +-
drivers/spi/spi-loopback-test.c | 4 +-
drivers/spi/spi-oc-tiny.c | 6 +-
drivers/spi/spi-omap-uwire.c | 4 +-
drivers/spi/spi-sh-sci.c | 10 +--
drivers/spi/spi-slave-mt27xx.c | 2 +-
drivers/spi/spi-xilinx.c | 4 +-
drivers/spi/spi-xtensa-xtfpga.c | 2 +-
drivers/spi/spi.c | 2 +-
drivers/spi/spidev.c | 2 +-
drivers/staging/fbtft/fbtft-core.c | 4 +-
drivers/staging/greybus/spilib.c | 66 ++++++++---------
drivers/usb/gadget/udc/max3420_udc.c | 2 +-
drivers/video/fbdev/mmp/hw/mmp_spi.c | 26 +++----
include/linux/spi/spi.h | 20 +----
include/linux/spi/spi_bitbang.h | 2 +-
include/media/v4l2-common.h | 6 +-
47 files changed, 253 insertions(+), 272 deletions(-)
base-commit: b9b98f594b6f4c0b0fb2da4493453aef183bca4b
--
2.43.0
MikroBUS is an open standard developed by MikroElektronika for connecting
add-on boards to microcontrollers or microprocessors. It essentially
allows you to easily expand the functionality of your main boards using
these add-on boards.
This patchset adds mikroBUS as a Linux bus type and provides a driver to
parse and register the mikroBUS board using mikroBUS manifest.
The patchset is based on work originally done by Vaishnav.
Link: https://www.mikroe.com/mikrobus
Link: https://docs.beagleboard.org/latest/boards/beagleplay/
Link: https://lore.kernel.org/lkml/20240315184908.500352-1-ayushdevel1325@gmail.c… Patch v3
Changes v4:
- Better commit messages
- Remove clickID, serdev, pwm, regulator, clocks etc. Just the basic
mikroBUS driver.
- Fix a lot of memory leaks, unused variables, etc.
- Create accompanying PR in Greybus Spec repository
- Switch to 80 columns formatting
- Some other fixes pointed out in v3
Changes in v3:
- Use phandle instead of busname for spi
- Use spi board info for registering new device
- Convert dt bindings to yaml
- Add support for clickID
- Code cleanup and style changes
- Additions required to spi, serdev, w1 and regulator subsystems
Changes in v2:
- support for adding mikroBUS ports from DT overlays,
- remove debug sysFS interface for adding mikrobus ports,
- consider extended pin usage/deviations from mikrobus standard
specifications
- use greybus CPort protocol enum instead of new protocol enums
- Fix cases of wrong indentation, ignoring return values, freeing allocated
resources in case of errors and other style suggestions in v1 review.
Ayush Singh (5):
dt-bindings: misc: Add mikrobus-connector
spi: Make of_find_spi_controller_by_node() available
greybus: Add mikroBUS manifest types
mikrobus: Add mikroBUS driver
dts: ti: k3-am625-beagleplay: Add mikroBUS
.../connector/mikrobus-connector.yaml | 113 +++
MAINTAINERS | 7 +
.../arm64/boot/dts/ti/k3-am625-beagleplay.dts | 80 +-
drivers/misc/Kconfig | 1 +
drivers/misc/Makefile | 1 +
drivers/misc/mikrobus/Kconfig | 15 +
drivers/misc/mikrobus/Makefile | 5 +
drivers/misc/mikrobus/mikrobus_core.c | 696 ++++++++++++++++++
drivers/misc/mikrobus/mikrobus_core.h | 151 ++++
drivers/misc/mikrobus/mikrobus_manifest.c | 503 +++++++++++++
drivers/misc/mikrobus/mikrobus_manifest.h | 29 +
drivers/spi/spi.c | 206 +++---
include/linux/greybus/greybus_manifest.h | 49 ++
include/linux/spi/spi.h | 4 +
14 files changed, 1750 insertions(+), 110 deletions(-)
create mode 100644 Documentation/devicetree/bindings/connector/mikrobus-connector.yaml
create mode 100644 drivers/misc/mikrobus/Kconfig
create mode 100644 drivers/misc/mikrobus/Makefile
create mode 100644 drivers/misc/mikrobus/mikrobus_core.c
create mode 100644 drivers/misc/mikrobus/mikrobus_core.h
create mode 100644 drivers/misc/mikrobus/mikrobus_manifest.c
create mode 100644 drivers/misc/mikrobus/mikrobus_manifest.h
base-commit: 61996c073c9b070922ad3a36c981ca6ddbea19a5
--
2.44.0
Dereference of null pointer in the __gb_lights_flash_brightness_set function.
Assigning the channel the result of executing the get_channel_from_mode function
without checking for NULL may result in an error.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 2870b52bae4c ("greybus: lights: add lights implementation")
Signed-off-by: Mikhail Lobanov <m.lobanov(a)rosalinux.ru>
---
drivers/staging/greybus/light.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c
index 87d36948c610..929514350947 100644
--- a/drivers/staging/greybus/light.c
+++ b/drivers/staging/greybus/light.c
@@ -148,10 +148,15 @@ static int __gb_lights_flash_brightness_set(struct gb_channel *channel)
GB_CHANNEL_MODE_TORCH);
/* For not flash we need to convert brightness to intensity */
- intensity = channel->intensity_uA.min +
+
+ if (channel) {
+ intensity = channel->intensity_uA.min +
(channel->intensity_uA.step * channel->led->brightness);
- return __gb_lights_flash_intensity_set(channel, intensity);
+ return __gb_lights_flash_intensity_set(channel, intensity);
+ }
+
+ return 0;
}
#else
static struct gb_channel *get_channel_from_cdev(struct led_classdev *cdev)
--
2.43.0