Re: [PATCH v5 2/7] platform/chrome: cros_typec_switch: Add switch driver

From: Tzung-Bi Shih
Date: Tue Aug 16 2022 - 03:56:46 EST


On Mon, Aug 15, 2022 at 06:34:19AM +0000, Prashant Malani wrote:
> Introduce a driver to configure USB Type-C mode switches and retimers
> which are controlled by the Chrome OS EC (Embedded Controller).
> This allows Type-C port drivers, as well as alternate mode drivers to
> configure their relevant mode switches and retimers according to the
> Type-C state they want to achieve.

s/Chrome OS/ChromeOS/.

> diff --git a/drivers/platform/chrome/Kconfig b/drivers/platform/chrome/Kconfig
[...]
> +config CROS_TYPEC_SWITCH
> + tristate "ChromeOS EC Type-C Switch Control"
> + depends on MFD_CROS_EC_DEV && TYPEC && ACPI
> + default MFD_CROS_EC_DEV
> + help
> + If you say Y here, you get support for configuring the Chrome OS EC Type C
> + muxes and retimers.

s/Chrome OS/ChromeOS/.

Up to you, s/Type C/Type-C/g.

> diff --git a/drivers/platform/chrome/cros_typec_switch.c b/drivers/platform/chrome/cros_typec_switch.c
> new file mode 100644
> index 000000000000..0d319e315d57
> --- /dev/null
> +++ b/drivers/platform/chrome/cros_typec_switch.c
> @@ -0,0 +1,170 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright 2022 Google LLC
> + *
> + * This driver provides the ability to configure Type C muxes and retimers which are controlled by
> + * the Chrome OS EC.
> + */

s/Chrome OS/ChromeOS/.

> +static int cros_typec_register_switches(struct cros_typec_switch_data *sdata)
> +{
> + struct cros_typec_port *port = NULL;
> + struct device *dev = sdata->dev;
> + struct fwnode_handle *fwnode;
> + struct acpi_device *adev;
> + unsigned long long index;
> + int ret = 0;

`port` and `ret` don't need to be initialized.

> +MODULE_DESCRIPTION("Chrome OS EC Type C Switch control");

s/Chrome OS/ChromeOS/.