[PATCH v2 0/6] can: mcp251xfd: add gpio functionality

Gregor Herburger posted 6 patches 1 year, 7 months ago
There is a newer version of this series
.../bindings/net/can/microchip,mcp251xfd.yaml      |   5 +
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c     | 310 +++++++++++++++++----
drivers/net/can/spi/mcp251xfd/mcp251xfd-dump.c     |   2 +-
drivers/net/can/spi/mcp251xfd/mcp251xfd-regmap.c   |  31 ++-
drivers/net/can/spi/mcp251xfd/mcp251xfd-tef.c      |   2 +-
.../net/can/spi/mcp251xfd/mcp251xfd-timestamp.c    |   7 +-
drivers/net/can/spi/mcp251xfd/mcp251xfd-tx.c       |   2 +-
drivers/net/can/spi/mcp251xfd/mcp251xfd.h          |   7 +
8 files changed, 303 insertions(+), 63 deletions(-)
[PATCH v2 0/6] can: mcp251xfd: add gpio functionality
Posted by Gregor Herburger 1 year, 7 months ago
Hi all,

The mcp251xfd allows two pins to be configured as GPIOs. This series
adds support for this feature.

The GPIO functionality is controlled with the IOCON register which has
an erratum. The second patch is to work around this erratum. I am not
sure if the place for the check and workaround in
mcp251xfd_regmap_crc_write is correct or if the check could be bypassed
with a direct call to mcp251xfd_regmap_crc_gather_write. If you have a
better suggestion where to add the check please let me know.

Patch 1-3 from https://lore.kernel.org/linux-can/20240429-mcp251xfd-runtime_pm-v1-0-c26a93a66544@pengutronix.de/
Patch 4 is the fix/workaround for the aforementioned erratum
Patch 5 adds the gpio support
Patch 6 updates dt-binding

---
Changes in v2:
- picked Marcs patches from https://lore.kernel.org/linux-can/20240429-mcp251xfd-runtime_pm-v1-0-c26a93a66544@pengutronix.de/
- Drop regcache
- Add pm_runtime in mcp251xfd_gpio_request/mcp251xfd_gpio_free
- Implement mcp251xfd_gpio_get_multiple/mcp251xfd_gpio_set_multiple
- Move check for rx_int/gpio conflict to mcp251xfd_gpio_request
- Link to v1: https://lore.kernel.org/r/20240417-mcp251xfd-gpio-feature-v1-0-bc0c61fd0c80@ew.tq-group.com

---
Gregor Herburger (3):
      can: mcp251xfd: mcp251xfd_regmap_crc_write(): workaround for errata 5
      can: mcp251xfd: add gpio functionality
      dt-bindings: can: mcp251xfd: add gpio-controller property

Marc Kleine-Budde (3):
      can: mcp251xfd: properly indent labels
      can: mcp251xfd: move mcp251xfd_timestamp_start()/stop() into mcp251xfd_chip_start/stop()
      can: mcp251xfd: move chip sleep mode into runtime pm

 .../bindings/net/can/microchip,mcp251xfd.yaml      |   5 +
 drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c     | 310 +++++++++++++++++----
 drivers/net/can/spi/mcp251xfd/mcp251xfd-dump.c     |   2 +-
 drivers/net/can/spi/mcp251xfd/mcp251xfd-regmap.c   |  31 ++-
 drivers/net/can/spi/mcp251xfd/mcp251xfd-tef.c      |   2 +-
 .../net/can/spi/mcp251xfd/mcp251xfd-timestamp.c    |   7 +-
 drivers/net/can/spi/mcp251xfd/mcp251xfd-tx.c       |   2 +-
 drivers/net/can/spi/mcp251xfd/mcp251xfd.h          |   7 +
 8 files changed, 303 insertions(+), 63 deletions(-)
---
base-commit: 1fdad13606e104ff103ca19d2d660830cb36d43e
change-id: 20240417-mcp251xfd-gpio-feature-29a1bf6acb54

Best regards,
-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/

Re: [PATCH v2 0/6] can: mcp251xfd: add gpio functionality
Posted by Marc Kleine-Budde 1 year, 7 months ago
On 06.05.2024 07:59:42, Gregor Herburger wrote:
> Hi all,
> 
> The mcp251xfd allows two pins to be configured as GPIOs. This series
> adds support for this feature.
> 
> The GPIO functionality is controlled with the IOCON register which has
> an erratum. The second patch is to work around this erratum. I am not
                  ^^^^^^
> sure if the place for the check and workaround in
> mcp251xfd_regmap_crc_write is correct or if the check could be bypassed
> with a direct call to mcp251xfd_regmap_crc_gather_write. If you have a
> better suggestion where to add the check please let me know.

Yes, better move the workaround to mcp251xfd_regmap_crc_gather_write().
I don't remember under which circumstances regmap uses the
gather_write() or the write() function.

> Patch 1-3 from https://lore.kernel.org/linux-can/20240429-mcp251xfd-runtime_pm-v1-0-c26a93a66544@pengutronix.de/

Nitpick: Please add your S-o-b to these patches.

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |