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

Viken Dadhaniya posted 6 patches 4 months, 1 week ago
.../bindings/net/can/microchip,mcp251xfd.yaml |   5 +
drivers/net/can/spi/mcp251xfd/Kconfig         |   1 +
.../net/can/spi/mcp251xfd/mcp251xfd-core.c    | 273 +++++++++++++++---
.../net/can/spi/mcp251xfd/mcp251xfd-regmap.c  | 114 ++++++--
drivers/net/can/spi/mcp251xfd/mcp251xfd.h     |   8 +
5 files changed, 335 insertions(+), 66 deletions(-)
[PATCH v6 0/6] can: mcp251xfd: add gpio functionality
Posted by Viken Dadhaniya 4 months, 1 week 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.

Patch 1 from https://lore.kernel.org/linux-can/20240429-mcp251xfd-runtime_pm-v1-3-c26a93a66544@pengutronix.de/
Patch 2 refactor of no-crc functions to prepare workaround for non-crc writes
Patch 3 is the fix/workaround for the aforementioned erratum
Patch 4 only configure pin1 for rx-int
Patch 5 adds the gpio support
Patch 6 updates dt-binding

As per Marc's comment on below patch, we aim to get this series into
linux-next since the functionality is essential for CAN on the RB3 Gen2
board. As progress has stalled, Take this series forward with minor code
adjustments. Include a Tested-by tag to reflect validation performed on the
target hardware.

https://lore.kernel.org/all/20240806-industrious-augmented-crane-44239a-mkl@pengutronix.de/
---
Changes in v6:
- Simplified error handling by directly returning regmap_update_bits() result.
- Added Acked-By tag.
- Link to v5: https://lore.kernel.org/all/20250926133018.3071446-1-viken.dadhaniya@oss.qualcomm.com/

Changes in v5:
- Removed #ifdef GPIOLIB and added select GPIOLIB in Kconfig
- Rebased patch on latest baseline
- Resolved Kernel Test Robot warnings
- Link to v4: https://lore.kernel.org/all/20250918064903.241372-1-viken.dadhaniya@oss.qualcomm.com/

Changes in v4:
- Moved GPIO register initialization into mcp251xfd_register after enabling
  runtime PM to avoid GPIO request failures when using the gpio-hog
  property to set default GPIO state.
- Added Tested-by and Signed-off-by tags.
- Dropped the 1st and 2nd patches from the v3 series as they have already been merged.
- Link to v3: https://lore.kernel.org/linux-can/20240522-mcp251xfd-gpio-feature-v3-0-8829970269c5@ew.tq-group.com/

Changes in v3:
- Implement workaround for non-crc writes
- Configure only Pin1 for rx-int feature
- moved errata check to .gather_write callback function
- Added MCP251XFD_REG_IOCON_*() macros
- Added Marcs suggestions
- Collect Krzysztofs Acked-By
- Link to v2: https://lore.kernel.org/r/20240506-mcp251xfd-gpio-feature-v2-0-615b16fa8789@ew.tq-group.com

---
Gregor Herburger (5):
  can: mcp251xfd: utilize gather_write function for all non-CRC writes
  can: mcp251xfd: add workaround for errata 5
  can: mcp251xfd: only configure PIN1 when rx_int is set
  can: mcp251xfd: add gpio functionality
  dt-bindings: can: mcp251xfd: add gpio-controller property

Marc Kleine-Budde (1):
  can: mcp251xfd: move chip sleep mode into runtime pm

 .../bindings/net/can/microchip,mcp251xfd.yaml |   5 +
 drivers/net/can/spi/mcp251xfd/Kconfig         |   1 +
 .../net/can/spi/mcp251xfd/mcp251xfd-core.c    | 273 +++++++++++++++---
 .../net/can/spi/mcp251xfd/mcp251xfd-regmap.c  | 114 ++++++--
 drivers/net/can/spi/mcp251xfd/mcp251xfd.h     |   8 +
 5 files changed, 335 insertions(+), 66 deletions(-)

-- 
2.34.1
Re: [PATCH v6 0/6] can: mcp251xfd: add gpio functionality
Posted by Marc Kleine-Budde 2 months, 3 weeks ago
On 01.10.2025 14:40:00, Viken Dadhaniya 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.
>
> Patch 1 from https://lore.kernel.org/linux-can/20240429-mcp251xfd-runtime_pm-v1-3-c26a93a66544@pengutronix.de/
> Patch 2 refactor of no-crc functions to prepare workaround for non-crc writes
> Patch 3 is the fix/workaround for the aforementioned erratum
> Patch 4 only configure pin1 for rx-int
> Patch 5 adds the gpio support
> Patch 6 updates dt-binding
>
> As per Marc's comment on below patch, we aim to get this series into
> linux-next since the functionality is essential for CAN on the RB3 Gen2
> board. As progress has stalled, Take this series forward with minor code
> adjustments. Include a Tested-by tag to reflect validation performed on the
> target hardware.
>
> https://lore.kernel.org/all/20240806-industrious-augmented-crane-44239a-mkl@pengutronix.de/

Applied to linux-can-next.

Thanks,
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   |
Re: [PATCH v6 0/6] can: mcp251xfd: add gpio functionality
Posted by Manivannan Sadhasivam 3 months, 2 weeks ago
On Wed, Oct 01, 2025 at 02:40:00PM +0530, Viken Dadhaniya 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.
> 
> Patch 1 from https://lore.kernel.org/linux-can/20240429-mcp251xfd-runtime_pm-v1-3-c26a93a66544@pengutronix.de/
> Patch 2 refactor of no-crc functions to prepare workaround for non-crc writes
> Patch 3 is the fix/workaround for the aforementioned erratum
> Patch 4 only configure pin1 for rx-int
> Patch 5 adds the gpio support
> Patch 6 updates dt-binding
> 
> As per Marc's comment on below patch, we aim to get this series into
> linux-next since the functionality is essential for CAN on the RB3 Gen2
> board. As progress has stalled, Take this series forward with minor code
> adjustments. Include a Tested-by tag to reflect validation performed on the
> target hardware.
> 

LGTM! For the series,

Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>

- Mani

> https://lore.kernel.org/all/20240806-industrious-augmented-crane-44239a-mkl@pengutronix.de/
> ---
> Changes in v6:
> - Simplified error handling by directly returning regmap_update_bits() result.
> - Added Acked-By tag.
> - Link to v5: https://lore.kernel.org/all/20250926133018.3071446-1-viken.dadhaniya@oss.qualcomm.com/
> 
> Changes in v5:
> - Removed #ifdef GPIOLIB and added select GPIOLIB in Kconfig
> - Rebased patch on latest baseline
> - Resolved Kernel Test Robot warnings
> - Link to v4: https://lore.kernel.org/all/20250918064903.241372-1-viken.dadhaniya@oss.qualcomm.com/
> 
> Changes in v4:
> - Moved GPIO register initialization into mcp251xfd_register after enabling
>   runtime PM to avoid GPIO request failures when using the gpio-hog
>   property to set default GPIO state.
> - Added Tested-by and Signed-off-by tags.
> - Dropped the 1st and 2nd patches from the v3 series as they have already been merged.
> - Link to v3: https://lore.kernel.org/linux-can/20240522-mcp251xfd-gpio-feature-v3-0-8829970269c5@ew.tq-group.com/
> 
> Changes in v3:
> - Implement workaround for non-crc writes
> - Configure only Pin1 for rx-int feature
> - moved errata check to .gather_write callback function
> - Added MCP251XFD_REG_IOCON_*() macros
> - Added Marcs suggestions
> - Collect Krzysztofs Acked-By
> - Link to v2: https://lore.kernel.org/r/20240506-mcp251xfd-gpio-feature-v2-0-615b16fa8789@ew.tq-group.com
> 
> ---
> Gregor Herburger (5):
>   can: mcp251xfd: utilize gather_write function for all non-CRC writes
>   can: mcp251xfd: add workaround for errata 5
>   can: mcp251xfd: only configure PIN1 when rx_int is set
>   can: mcp251xfd: add gpio functionality
>   dt-bindings: can: mcp251xfd: add gpio-controller property
> 
> Marc Kleine-Budde (1):
>   can: mcp251xfd: move chip sleep mode into runtime pm
> 
>  .../bindings/net/can/microchip,mcp251xfd.yaml |   5 +
>  drivers/net/can/spi/mcp251xfd/Kconfig         |   1 +
>  .../net/can/spi/mcp251xfd/mcp251xfd-core.c    | 273 +++++++++++++++---
>  .../net/can/spi/mcp251xfd/mcp251xfd-regmap.c  | 114 ++++++--
>  drivers/net/can/spi/mcp251xfd/mcp251xfd.h     |   8 +
>  5 files changed, 335 insertions(+), 66 deletions(-)
> 
> -- 
> 2.34.1
> 

-- 
மணிவண்ணன் சதாசிவம்
Re: [PATCH v6 0/6] can: mcp251xfd: add gpio functionality
Posted by Viken Dadhaniya 2 months, 4 weeks ago
Hi Marc

I wanted to follow up on this patch series. I noticed it hasn’t been picked up yet,
so I wanted to check if there are any remaining concerns or comments that need to be addressed.

Thanks
Viken Dadhaniya

On 10/23/2025 10:46 AM, Manivannan Sadhasivam wrote:
> On Wed, Oct 01, 2025 at 02:40:00PM +0530, Viken Dadhaniya 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.
>>
>> Patch 1 from https://lore.kernel.org/linux-can/20240429-mcp251xfd-runtime_pm-v1-3-c26a93a66544@pengutronix.de/
>> Patch 2 refactor of no-crc functions to prepare workaround for non-crc writes
>> Patch 3 is the fix/workaround for the aforementioned erratum
>> Patch 4 only configure pin1 for rx-int
>> Patch 5 adds the gpio support
>> Patch 6 updates dt-binding
>>
>> As per Marc's comment on below patch, we aim to get this series into
>> linux-next since the functionality is essential for CAN on the RB3 Gen2
>> board. As progress has stalled, Take this series forward with minor code
>> adjustments. Include a Tested-by tag to reflect validation performed on the
>> target hardware.
>>
> 
> LGTM! For the series,
> 
> Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
> 
> - Mani> 
>> https://lore.kernel.org/all/20240806-industrious-augmented-crane-44239a-mkl@pengutronix.de/
>> ---
>> Changes in v6:
>> - Simplified error handling by directly returning regmap_update_bits() result.
>> - Added Acked-By tag.
>> - Link to v5: https://lore.kernel.org/all/20250926133018.3071446-1-viken.dadhaniya@oss.qualcomm.com/
>>
>> Changes in v5:
>> - Removed #ifdef GPIOLIB and added select GPIOLIB in Kconfig
>> - Rebased patch on latest baseline
>> - Resolved Kernel Test Robot warnings
>> - Link to v4: https://lore.kernel.org/all/20250918064903.241372-1-viken.dadhaniya@oss.qualcomm.com/
>>
>> Changes in v4:
>> - Moved GPIO register initialization into mcp251xfd_register after enabling
>>   runtime PM to avoid GPIO request failures when using the gpio-hog
>>   property to set default GPIO state.
>> - Added Tested-by and Signed-off-by tags.
>> - Dropped the 1st and 2nd patches from the v3 series as they have already been merged.
>> - Link to v3: https://lore.kernel.org/linux-can/20240522-mcp251xfd-gpio-feature-v3-0-8829970269c5@ew.tq-group.com/
>>
>> Changes in v3:
>> - Implement workaround for non-crc writes
>> - Configure only Pin1 for rx-int feature
>> - moved errata check to .gather_write callback function
>> - Added MCP251XFD_REG_IOCON_*() macros
>> - Added Marcs suggestions
>> - Collect Krzysztofs Acked-By
>> - Link to v2: https://lore.kernel.org/r/20240506-mcp251xfd-gpio-feature-v2-0-615b16fa8789@ew.tq-group.com
>>
>> ---
>> Gregor Herburger (5):
>>   can: mcp251xfd: utilize gather_write function for all non-CRC writes
>>   can: mcp251xfd: add workaround for errata 5
>>   can: mcp251xfd: only configure PIN1 when rx_int is set
>>   can: mcp251xfd: add gpio functionality
>>   dt-bindings: can: mcp251xfd: add gpio-controller property
>>
>> Marc Kleine-Budde (1):
>>   can: mcp251xfd: move chip sleep mode into runtime pm
>>
>>  .../bindings/net/can/microchip,mcp251xfd.yaml |   5 +
>>  drivers/net/can/spi/mcp251xfd/Kconfig         |   1 +
>>  .../net/can/spi/mcp251xfd/mcp251xfd-core.c    | 273 +++++++++++++++---
>>  .../net/can/spi/mcp251xfd/mcp251xfd-regmap.c  | 114 ++++++--
>>  drivers/net/can/spi/mcp251xfd/mcp251xfd.h     |   8 +
>>  5 files changed, 335 insertions(+), 66 deletions(-)
>>
>> -- 
>> 2.34.1
>>
>