[PATCH v4 04/13] usb: typec: add fwnode to tcpc

Heikki Krogerus heikki.krogerus at linux.intel.com
Thu Mar 29 12:57:45 UTC 2018


Hi,

On Thu, Mar 29, 2018 at 12:06:09AM +0800, Li Jun wrote:
> Add fwnode handle to get the fwnode so we can get typec configs
> it contains.
> 
> Suggested-by: Heikki Krogerus <heikki.krogerus at linux.intel.com>
> Signed-off-by: Li Jun <jun.li at nxp.com>
> ---
>  drivers/staging/typec/tcpci.c | 14 +++++++-------
>  drivers/usb/typec/tcpm.c      |  1 +
>  include/linux/usb/tcpm.h      |  2 ++
>  3 files changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/typec/tcpci.c b/drivers/staging/typec/tcpci.c
> index ed76327..4f7ad10 100644
> --- a/drivers/staging/typec/tcpci.c
> +++ b/drivers/staging/typec/tcpci.c
> @@ -10,6 +10,7 @@
>  #include <linux/module.h>
>  #include <linux/i2c.h>
>  #include <linux/interrupt.h>
> +#include <linux/property.h>
>  #include <linux/regmap.h>
>  #include <linux/usb/pd.h>
>  #include <linux/usb/tcpm.h>
> @@ -463,17 +464,16 @@ static const struct regmap_config tcpci_regmap_config = {
>  	.max_register = 0x7F, /* 0x80 .. 0xFF are vendor defined */
>  };
>  
> -static const struct tcpc_config tcpci_tcpc_config = {
> -	.type = TYPEC_PORT_DFP,
> -	.default_role = TYPEC_SINK,
> -};
> -
>  static int tcpci_parse_config(struct tcpci *tcpci)
>  {
>  	tcpci->controls_vbus = true; /* XXX */
>  
> -	/* TODO: Populate struct tcpc_config from ACPI/device-tree */
> -	tcpci->tcpc.config = &tcpci_tcpc_config;

That will break bisectablitity. tcpm.c is still accessing the config
at this point.

Just leave those untouched in here, and clean-up in separate patch
that comes after the patch that prepares tcpm.c.


Thanks,

-- 
heikki


More information about the devel mailing list