[PATCH net-next 14/15] net: sparx5: add compatible strings for lan969x and verify the target
Krzysztof Kozlowski
krzk at kernel.org
Mon Oct 21 23:09:37 PDT 2024
On Mon, Oct 21, 2024 at 03:58:51PM +0200, Daniel Machon wrote:
> @@ -227,6 +229,168 @@ bool is_sparx5(struct sparx5 *sparx5)
> }
> }
>
> +/* Set the devicetree target based on the compatible string */
> +static int sparx5_set_target_dt(struct sparx5 *sparx5)
> +{
> + struct device_node *node = sparx5->pdev->dev.of_node;
> +
> + if (is_sparx5(sparx5))
> + /* For Sparx5 the devicetree target is always the chip target */
> + sparx5->target_dt = sparx5->target_ct;
> + else if (of_device_is_compatible(node, "microchip,lan9691-switch"))
> + sparx5->target_dt = SPX5_TARGET_CT_LAN9691VAO;
> + else if (of_device_is_compatible(node, "microchip,lan9692-switch"))
> + sparx5->target_dt = SPX5_TARGET_CT_LAN9692VAO;
> + else if (of_device_is_compatible(node, "microchip,lan9693-switch"))
> + sparx5->target_dt = SPX5_TARGET_CT_LAN9693VAO;
> + else if (of_device_is_compatible(node, "microchip,lan9694-switch"))
> + sparx5->target_dt = SPX5_TARGET_CT_LAN9694;
> + else if (of_device_is_compatible(node, "microchip,lan9695-switch"))
> + sparx5->target_dt = SPX5_TARGET_CT_LAN9694TSN;
> + else if (of_device_is_compatible(node, "microchip,lan9696-switch"))
> + sparx5->target_dt = SPX5_TARGET_CT_LAN9696;
> + else if (of_device_is_compatible(node, "microchip,lan9697-switch"))
> + sparx5->target_dt = SPX5_TARGET_CT_LAN9696TSN;
> + else if (of_device_is_compatible(node, "microchip,lan9698-switch"))
> + sparx5->target_dt = SPX5_TARGET_CT_LAN9698;
> + else if (of_device_is_compatible(node, "microchip,lan9699-switch"))
> + sparx5->target_dt = SPX5_TARGET_CT_LAN9698TSN;
> + else if (of_device_is_compatible(node, "microchip,lan969a-switch"))
> + sparx5->target_dt = SPX5_TARGET_CT_LAN9694RED;
> + else if (of_device_is_compatible(node, "microchip,lan969b-switch"))
> + sparx5->target_dt = SPX5_TARGET_CT_LAN9696RED;
> + else if (of_device_is_compatible(node, "microchip,lan969c-switch"))
> + sparx5->target_dt = SPX5_TARGET_CT_LAN9698RED;
Do not re-implement match data.
>
More information about the linux-arm-kernel
mailing list