[PATCH v6 3/9] phy: phy-can-transceiver: Add dual channel support for TJA1048

Marc Kleine-Budde mkl at pengutronix.de
Fri Sep 19 12:11:00 PDT 2025


On 09.09.2025 13:40:13, Peng Fan wrote:
> - Introduce new flag CAN_TRANSCEIVER_DUAL_CH to indicate the phy has two
>   channels.
> - Alloc a phy for each channel
> - Support TJA1048 which is a dual high-speed CAN transceiver with sleep
>   mode supported.
> - Add can_transceiver_phy_xlate for parsing phy
> 
> Reviewed-by: Frank Li <Frank.Li at nxp.com>
> Signed-off-by: Peng Fan <peng.fan at nxp.com>
> ---
>  drivers/phy/phy-can-transceiver.c | 91 ++++++++++++++++++++++++++++-----------
>  1 file changed, 65 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/phy/phy-can-transceiver.c b/drivers/phy/phy-can-transceiver.c
> index 6415c6af0e8414a6cc8d15958a17ee749a3f28e9..f06b1df76ada023f432dce892c3346f45397ab54 100644
> --- a/drivers/phy/phy-can-transceiver.c
> +++ b/drivers/phy/phy-can-transceiver.c
> @@ -17,6 +17,7 @@ struct can_transceiver_data {
>  	u32 flags;
>  #define CAN_TRANSCEIVER_STB_PRESENT	BIT(0)
>  #define CAN_TRANSCEIVER_EN_PRESENT	BIT(1)
> +#define CAN_TRANSCEIVER_DUAL_CH		BIT(2)
>  };
>  
>  struct can_transceiver_phy {
> @@ -29,6 +30,7 @@ struct can_transceiver_phy {
>  struct can_transceiver_priv {
>  	struct can_transceiver_phy *can_transceiver_phy;
>  	struct mux_state *mux_state;
> +	int num_ch;

As a flexible array this looks like:

struct can_transceiver_priv {
        struct can_transceiver_phy *can_transceiver_phy;
        int num_ch;
        struct mux_state mux_state[] __counted_by(num_ch);
}

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   |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20250919/492399d0/attachment-0001.sig>


More information about the linux-arm-kernel mailing list