| 1f383ee4 | 12-Oct-2022 |
Michal Suchanek <msuchanek@suse.de> |
UPSTREAM: dm: core: Do not stop uclass iteration on error
When probing a device fails NULL pointer is returned, and following devices in uclass list cannot be iterated. Skip to next device on error
UPSTREAM: dm: core: Do not stop uclass iteration on error
When probing a device fails NULL pointer is returned, and following devices in uclass list cannot be iterated. Skip to next device on error instead.
With that the only condition under which these simple iteration functions return error is when the dm is not initialized at uclass_get time. This is not all that interesting, change return type to void.
Fixes: 6494d708bf ("dm: Add base driver model support") Change-Id: Ie327dc21db7ee80f9fc32e7913be2af71bb074a7 Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> (cherry picked from commit f21954750aa8ed445ab83998bb099e366136c428) Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
show more ...
|
| d1cab63e | 12-Oct-2022 |
Michal Suchanek <msuchanek@suse.de> |
UPSTREAM: dm: core: Switch uclass_*_device_err to use uclass_*_device_check
The _err variant iterators use the simple iterators without suffix as basis.
However, there is no user that uclass_next_d
UPSTREAM: dm: core: Switch uclass_*_device_err to use uclass_*_device_check
The _err variant iterators use the simple iterators without suffix as basis.
However, there is no user that uclass_next_device_err for iteration, many users of uclass_first_device_err use it to get the first and (assumed) only device of an uclass, and a couple that use uclass_next_device_err to get the device following a known device in the uclass list.
While there are some truly singleton device classes in which more than one device cannot exist these are quite rare, and most classes can have multiple devices even if it is not the case on the SoC's EVB.
In a later patch the simple iterators will be updated to not stop on error and return next device instead. With this in many cases the code that expects the first device or an error if it fails to probe may get the next device instead. Use the _check iterators as the basis of _err iterators to preserve the old behavior.
Change-Id: Ia4a249c906a12db0cda69d44097a4fd3682d2ed9 Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> (cherry picked from commit e44d7e73fe0d649693d8d0a110cd7632bc919273) Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
show more ...
|
| 771aadba | 06-Feb-2020 |
Simon Glass <sjg@chromium.org> |
UPSTREAM: dm: core: Add a function to find a device by drvdata
It is sometimes useful to find a device in a uclass using only its driver data. The driver data often indicates the 'subtype' of the de
UPSTREAM: dm: core: Add a function to find a device by drvdata
It is sometimes useful to find a device in a uclass using only its driver data. The driver data often indicates the 'subtype' of the device, e,g, via its compatible string.
Add a function to handle this.
Change-Id: I6668a2a29c29346f57d3d975838459c0ac90fdea Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> (cherry picked from commit 50162348f0d3b915004733131acd81805e202c76) Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
show more ...
|
| 2c3c84fc | 06-Feb-2020 |
Simon Glass <sjg@chromium.org> |
UPSTREAM: dm: core: Allow iterating devices without uclass_get()
At present we have uclass_foreach_dev() which requires that uclass_get() be called beforehand to find the uclass. This is good if we
UPSTREAM: dm: core: Allow iterating devices without uclass_get()
At present we have uclass_foreach_dev() which requires that uclass_get() be called beforehand to find the uclass. This is good if we suspect that that function might fail, but often we know that the uclass is available.
Add a new helper which does this uclass_get() automatically, so that only the uclass ID is needed.
Change-Id: I3106b199653bf8a32d2d1a0025b77261881716fc Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> (cherry picked from commit 3cf0fba4ff862d833545f82fb2209ff3c79d17b5) Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
show more ...
|
| 386f9d4c | 14-Sep-2020 |
Sean Anderson <seanga2@gmail.com> |
UPSTREAM: pinctrl: Add pinmux property support to pinctrl-generic
The pinmux property allows for smaller and more compact device trees, especially when there are many pins which need to be assigned
UPSTREAM: pinctrl: Add pinmux property support to pinctrl-generic
The pinmux property allows for smaller and more compact device trees, especially when there are many pins which need to be assigned individually. Instead of specifying an array of strings to be parsed as pins and a function property, the pinmux property contains an array of integers representing pinmux groups. A pinmux group consists of the pin identifier and mux settings represented as a single integer or an array of integers. Each individual pin controller driver specifies the exact format of a pinmux group. As specified in the Linux documentation, a pinmux group may be multiple integers long. However, no existing drivers use multi-integer pinmux groups, so I have chosen to omit this feature. This makes the implementation easier, since there is no need to allocate a buffer to do endian conversions.
Support for the pinmux property is done differently than in Linux. As far as I can tell, inversion of control is used when implementing support for the pins and groups properties to avoid allocating. This results in some duplication of effort; every property in a config node is parsed once for each pin in that node. This is not such an overhead with pins and groups properties, since having multiple pins in one config node does not occur especially often. However, the semantics of the pinmux property make such a configuration much more appealing. A future patch could parse all config properties at once and store them in an array. This would make it easier to create drivers which do not function solely as callbacks from pinctrl-generic.
This commit increases the size of the sandbox build by approximately 48 bytes. However, it also decreases the size of the K210 device tree by 2 KiB from the previous version of this series.
The documentation has been updated from the last Linux commit before it was split off into yaml files.
Change-Id: I25c7920371f950c5fece54492d5eae8e013529d5 Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> (cherry picked from commit 9c08fbfc951fa90953b75462e5dff533c0031a4d) Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
show more ...
|
| 0f850630 | 24-Oct-2018 |
Patrice Chotard <patrice.chotard@st.com> |
UPSTREAM: cmd: pinmux: Add pinmux command
pinmux command allows to : - list all pin-controllers available on platforms - select a pin-controller - display the muxing of all pins of the current pi
UPSTREAM: cmd: pinmux: Add pinmux command
pinmux command allows to : - list all pin-controllers available on platforms - select a pin-controller - display the muxing of all pins of the current pin-controller or all pin-controllers depending of given options
Signed-off-by: Patrice Chotard <patrice.chotard@st.com> cmd: pinmux: Fix pinmux command
if "pinmux status" command is used without having set dev using "pinmux dev", print pinmux usage Reviewed-by: Simon Glass <sjg@chromium.org>
(cherry picked from commit d5a8313905f54ebdf128ac428c3cf58a2ebcbda2) Change-Id: Ie23ca7b987bceb83724c3ddea42eddb579dc0ea5 Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
show more ...
|
| 563bfcf9 | 24-Oct-2018 |
Patrice Chotard <patrice.chotard@st.com> |
UPSTREAM: dm: uclass: Add uclass_foreach_dev_probe
Add uclass_foreach_dev_probe() which iterates through devices of a given uclass. Devices are probed if necessary and are ready to use.
Change-Id:
UPSTREAM: dm: uclass: Add uclass_foreach_dev_probe
Add uclass_foreach_dev_probe() which iterates through devices of a given uclass. Devices are probed if necessary and are ready to use.
Change-Id: Ia4561d234d8d4e8e55c3b1b318f411b8abce7627 Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org> (cherry picked from commit 37b596ac5c5f7ac405602af2577405b1f7d38cce) Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
show more ...
|
| d07fa43e | 24-Oct-2018 |
Patrice Chotard <patrice.chotard@st.com> |
UPSTREAM: dm: uclass: Add uclass_next_device_err() to return a valid device
Similarly to uclass_first_device_err(), add uclass_next_device_err() which returns an error if there are no next devices i
UPSTREAM: dm: uclass: Add uclass_next_device_err() to return a valid device
Similarly to uclass_first_device_err(), add uclass_next_device_err() which returns an error if there are no next devices in that uclass.
Change-Id: I44e34260045b15db3b19eeb0bbea725d80a956d2 Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org> (cherry picked from commit f6abd5389ceab5fce185126c2364a324465fafbe) Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
show more ...
|
| 26ad936d | 21-Apr-2019 |
Marek Vasut <marek.vasut+renesas@gmail.com> |
UPSTREAM: pinctrl: gpio: Add callback for configuring pin as GPIO
Add callback to configure, and de-configure, pin as a GPIO on the pin controller side. This matches similar functionality in Linux a
UPSTREAM: pinctrl: gpio: Add callback for configuring pin as GPIO
Add callback to configure, and de-configure, pin as a GPIO on the pin controller side. This matches similar functionality in Linux and aims to replace the ad-hoc implementations present in U-Boot.
Change-Id: Ic4c1e898c6c1054193e49bd011358008c1e4007e Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Alex Kiernan <alex.kiernan@gmail.com> Cc: Christoph Muellner <christoph.muellner@theobroma-systems.com> Cc: Eugeniu Rosca <roscaeugeniu@gmail.com> Cc: Patrice Chotard <patrice.chotard@st.com> Cc: Patrick DELAUNAY <patrick.delaunay@st.com> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Cc: Simon Glass <sjg@chromium.org> (cherry picked from commit ae59d7ca59dbfc770531f51c717dc6f5d9a18f78) Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
show more ...
|
| 6b9191d0 | 24-Oct-2018 |
Patrice Chotard <patrice.chotard@st.com> |
UPSTREAM: dm: pinctrl: Add get_pin_muxing() ops
Add get_pin_muxing() which allows to display the muxing of a given pin belonging to a pin-controller.
Change-Id: Icbc3b41ae38b695403f5757c1c0fb0a4155
UPSTREAM: dm: pinctrl: Add get_pin_muxing() ops
Add get_pin_muxing() which allows to display the muxing of a given pin belonging to a pin-controller.
Change-Id: Icbc3b41ae38b695403f5757c1c0fb0a4155e4dcd Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org> (cherry picked from commit f55a0c0a20cad56440ebe9a9b2999f21ae00f61a) Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
show more ...
|