Re: [PATCH v3 1/2] extcon: cros-ec: Add extcon-cros-ec driver to support display out.
Hi, On 2017년 07월 17일 17:54, Chanwoo Choi wrote: > Hi Enric, > > When I tried to apply this patch, error happened as following: > (based on v4.13-rc1) > > Applying: extcon: cros-ec: Add extcon-cros-ec driver to support display out. > error: patch failed: include/linux/mfd/cros_ec_commands.h:285 > error: include/linux/mfd/cros_ec_commands.h: patch does not apply > > Is it based on v4.13-rc1? Merge conflict is related to following issue: $ cat include/linux/mfd/cros_ec_commands.h.rej --- include/linux/mfd/cros_ec_commands.h +++ include/linux/mfd/cros_ec_commands.h @@ -285,10 +285,15 @@ EC_HOST_EVENT_HANG_DETECT = 20, /* Hang detect logic detected a hang and warm rebooted the AP */ EC_HOST_EVENT_HANG_REBOOT = 21, + /* PD MCU triggering host event */ + EC_HOST_EVENT_PD_MCU = 22, /* EC RTC event occurred */ EC_HOST_EVENT_RTC = 26, + /* EC desires to change state of host-controlled USB mux */ + EC_HOST_EVENT_USB_MUX = 28, + /* * The high bit of the event mask is not used as a host event code. If * it reads back as set, then the entire event mask should be > > > On 2017년 07월 17일 16:37, Enric Balletbo i Serra wrote: >> From: Benson Leung >> >> This is the driver for the USB Type C cable detection mechanism >> built into the ChromeOS Embedded Controller on systems that >> have USB Type-C ports. >> >> At present, this allows for the presence of display out, but in >> future, it may also be used to notify host and device type cables >> and the presence of power. >> >> Signed-off-by: Benson Leung >> Signed-off-by: Enric Balletbo i Serra >> Acked-by: Chanwoo Choi >> Acked-by: Lee Jones >> --- >> Changes since v2: >> - Rebase on top of v4.13-rc1 >> Changes since v1: >> Requested by Chanwoo Choi >> - Rename files changing _ for - >> - Remove the unneeded blank line on bottom of header. >> - Remove kobject.h and cros_ec_commands.h includes. >> - Remove the debug message as is not necessary. >> - Use the tab for indentation instead of space for if sentence. >> - Define each variable on different lines when the variables should be >>initialized. >> - Remove EXTCON_USB and EXTCON_USB_HOST as are not really used for now. >> - Add one blank line to split out between state and property setting. >> - Add the author information (header and module) >> >> Enric Balletbo >> - As Rob suggested to rename the compatible name to something indicating >> that >>is USB Type C related I also renamed the file names, extcon-cros-ec -> >>extcon-usbc-cros-ec, I think it's more clear. >> >> drivers/extcon/Kconfig | 7 + >> drivers/extcon/Makefile | 1 + >> drivers/extcon/extcon-usbc-cros-ec.c | 415 >> +++ >> include/linux/mfd/cros_ec_commands.h | 75 +++ >> 4 files changed, 498 insertions(+) >> create mode 100644 drivers/extcon/extcon-usbc-cros-ec.c >> >> diff --git a/drivers/extcon/Kconfig b/drivers/extcon/Kconfig >> index 6d50071..a7bca42 100644 >> --- a/drivers/extcon/Kconfig >> +++ b/drivers/extcon/Kconfig >> @@ -150,4 +150,11 @@ config EXTCON_USB_GPIO >>Say Y here to enable GPIO based USB cable detection extcon support. >>Used typically if GPIO is used for USB ID pin detection. >> >> +config EXTCON_USBC_CROS_EC >> +tristate "ChromeOS Embedded Controller EXTCON support" >> +depends on MFD_CROS_EC >> +help >> + Say Y here to enable USB Type C cable detection extcon support when >> + using Chrome OS EC based USB Type-C ports. >> + >> endif >> diff --git a/drivers/extcon/Makefile b/drivers/extcon/Makefile >> index ecfa958..a73624e 100644 >> --- a/drivers/extcon/Makefile >> +++ b/drivers/extcon/Makefile >> @@ -20,3 +20,4 @@ obj-$(CONFIG_EXTCON_QCOM_SPMI_MISC) += >> extcon-qcom-spmi-misc.o >> obj-$(CONFIG_EXTCON_RT8973A)+= extcon-rt8973a.o >> obj-$(CONFIG_EXTCON_SM5502) += extcon-sm5502.o >> obj-$(CONFIG_EXTCON_USB_GPIO) += extcon-usb-gpio.o >> +obj-$(CONFIG_EXTCON_USBC_CROS_EC) += extcon-usbc-cros-ec.o >> diff --git a/drivers/extcon/extcon-usbc-cros-ec.c >> b/drivers/extcon/extcon-usbc-cros-ec.c >> new file mode 100644 >> index 000..e759ed4 >> --- /dev/null >> +++ b/drivers/extcon/extcon-usbc-cros-ec.c >> @@ -0,0 +1,415 @@ >> +/** >> + * drivers/extcon/extcon-usbc-cros-ec - ChromeOS Embedded Controller extcon >> + * >> + * Copyright (C) 2017 Google, Inc >> + * Author: Benson Leung >> + * >> + * This software is licensed under the terms of the GNU General Public >> + * License version 2, as published by the Free Software Foundation, and >> + * may be copied, distributed, and modified under those terms. >> + * >> + * This program is distributed in the hope that it will be useful, >> + * but WITHOUT ANY WARRANTY; without even the implied warranty of >> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> + * GNU General Public License for more details. >> + */ >> +
Re: [PATCH v3 1/2] extcon: cros-ec: Add extcon-cros-ec driver to support display out.
Hi, 2017-07-17 10:54 GMT+02:00 Chanwoo Choi : > Hi Enric, > > When I tried to apply this patch, error happened as following: > (based on v4.13-rc1) > > Applying: extcon: cros-ec: Add extcon-cros-ec driver to support display out. > error: patch failed: include/linux/mfd/cros_ec_commands.h:285 > error: include/linux/mfd/cros_ec_commands.h: patch does not apply > Very sorry about that, I had another patch that touched this file and I forget to invert the sequence, first apply these patches then the others. Let me fix that and resend again in few minutes, Very sorry for the noise. > Is it based on v4.13-rc1? > > > On 2017년 07월 17일 16:37, Enric Balletbo i Serra wrote: >> From: Benson Leung >> >> This is the driver for the USB Type C cable detection mechanism >> built into the ChromeOS Embedded Controller on systems that >> have USB Type-C ports. >> >> At present, this allows for the presence of display out, but in >> future, it may also be used to notify host and device type cables >> and the presence of power. >> >> Signed-off-by: Benson Leung >> Signed-off-by: Enric Balletbo i Serra >> Acked-by: Chanwoo Choi >> Acked-by: Lee Jones >> --- >> Changes since v2: >> - Rebase on top of v4.13-rc1 >> Changes since v1: >> Requested by Chanwoo Choi >> - Rename files changing _ for - >> - Remove the unneeded blank line on bottom of header. >> - Remove kobject.h and cros_ec_commands.h includes. >> - Remove the debug message as is not necessary. >> - Use the tab for indentation instead of space for if sentence. >> - Define each variable on different lines when the variables should be >>initialized. >> - Remove EXTCON_USB and EXTCON_USB_HOST as are not really used for now. >> - Add one blank line to split out between state and property setting. >> - Add the author information (header and module) >> >> Enric Balletbo >> - As Rob suggested to rename the compatible name to something indicating >> that >>is USB Type C related I also renamed the file names, extcon-cros-ec -> >>extcon-usbc-cros-ec, I think it's more clear. >> >> drivers/extcon/Kconfig | 7 + >> drivers/extcon/Makefile | 1 + >> drivers/extcon/extcon-usbc-cros-ec.c | 415 >> +++ >> include/linux/mfd/cros_ec_commands.h | 75 +++ >> 4 files changed, 498 insertions(+) >> create mode 100644 drivers/extcon/extcon-usbc-cros-ec.c >> >> diff --git a/drivers/extcon/Kconfig b/drivers/extcon/Kconfig >> index 6d50071..a7bca42 100644 >> --- a/drivers/extcon/Kconfig >> +++ b/drivers/extcon/Kconfig >> @@ -150,4 +150,11 @@ config EXTCON_USB_GPIO >> Say Y here to enable GPIO based USB cable detection extcon support. >> Used typically if GPIO is used for USB ID pin detection. >> >> +config EXTCON_USBC_CROS_EC >> + tristate "ChromeOS Embedded Controller EXTCON support" >> + depends on MFD_CROS_EC >> + help >> + Say Y here to enable USB Type C cable detection extcon support when >> + using Chrome OS EC based USB Type-C ports. >> + >> endif >> diff --git a/drivers/extcon/Makefile b/drivers/extcon/Makefile >> index ecfa958..a73624e 100644 >> --- a/drivers/extcon/Makefile >> +++ b/drivers/extcon/Makefile >> @@ -20,3 +20,4 @@ obj-$(CONFIG_EXTCON_QCOM_SPMI_MISC) += >> extcon-qcom-spmi-misc.o >> obj-$(CONFIG_EXTCON_RT8973A) += extcon-rt8973a.o >> obj-$(CONFIG_EXTCON_SM5502) += extcon-sm5502.o >> obj-$(CONFIG_EXTCON_USB_GPIO)+= extcon-usb-gpio.o >> +obj-$(CONFIG_EXTCON_USBC_CROS_EC) += extcon-usbc-cros-ec.o >> diff --git a/drivers/extcon/extcon-usbc-cros-ec.c >> b/drivers/extcon/extcon-usbc-cros-ec.c >> new file mode 100644 >> index 000..e759ed4 >> --- /dev/null >> +++ b/drivers/extcon/extcon-usbc-cros-ec.c >> @@ -0,0 +1,415 @@ >> +/** >> + * drivers/extcon/extcon-usbc-cros-ec - ChromeOS Embedded Controller extcon >> + * >> + * Copyright (C) 2017 Google, Inc >> + * Author: Benson Leung >> + * >> + * This software is licensed under the terms of the GNU General Public >> + * License version 2, as published by the Free Software Foundation, and >> + * may be copied, distributed, and modified under those terms. >> + * >> + * This program is distributed in the hope that it will be useful, >> + * but WITHOUT ANY WARRANTY; without even the implied warranty of >> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> + * GNU General Public License for more details. >> + */ >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +struct cros_ec_extcon_info { >> + struct device *dev; >> + struct extcon_dev *edev; >> + >> + int port_id; >> + >> + struct cros_ec_device *ec; >> + >> + struct notifier_block notifier; >> + >> + bool dp; /* DisplayPort enabled */ >> + bool mux; /* SuperSpeed (usb3) enabled */ >> + unsigned int power_type; >> +}; >> + >> +static const unsigned int usb_type_c_cable[] = { >> + EXTCON
Re: [PATCH v3 1/2] extcon: cros-ec: Add extcon-cros-ec driver to support display out.
Hi Enric, When I tried to apply this patch, error happened as following: (based on v4.13-rc1) Applying: extcon: cros-ec: Add extcon-cros-ec driver to support display out. error: patch failed: include/linux/mfd/cros_ec_commands.h:285 error: include/linux/mfd/cros_ec_commands.h: patch does not apply Is it based on v4.13-rc1? On 2017년 07월 17일 16:37, Enric Balletbo i Serra wrote: > From: Benson Leung > > This is the driver for the USB Type C cable detection mechanism > built into the ChromeOS Embedded Controller on systems that > have USB Type-C ports. > > At present, this allows for the presence of display out, but in > future, it may also be used to notify host and device type cables > and the presence of power. > > Signed-off-by: Benson Leung > Signed-off-by: Enric Balletbo i Serra > Acked-by: Chanwoo Choi > Acked-by: Lee Jones > --- > Changes since v2: > - Rebase on top of v4.13-rc1 > Changes since v1: > Requested by Chanwoo Choi > - Rename files changing _ for - > - Remove the unneeded blank line on bottom of header. > - Remove kobject.h and cros_ec_commands.h includes. > - Remove the debug message as is not necessary. > - Use the tab for indentation instead of space for if sentence. > - Define each variable on different lines when the variables should be >initialized. > - Remove EXTCON_USB and EXTCON_USB_HOST as are not really used for now. > - Add one blank line to split out between state and property setting. > - Add the author information (header and module) > > Enric Balletbo > - As Rob suggested to rename the compatible name to something indicating that >is USB Type C related I also renamed the file names, extcon-cros-ec -> >extcon-usbc-cros-ec, I think it's more clear. > > drivers/extcon/Kconfig | 7 + > drivers/extcon/Makefile | 1 + > drivers/extcon/extcon-usbc-cros-ec.c | 415 > +++ > include/linux/mfd/cros_ec_commands.h | 75 +++ > 4 files changed, 498 insertions(+) > create mode 100644 drivers/extcon/extcon-usbc-cros-ec.c > > diff --git a/drivers/extcon/Kconfig b/drivers/extcon/Kconfig > index 6d50071..a7bca42 100644 > --- a/drivers/extcon/Kconfig > +++ b/drivers/extcon/Kconfig > @@ -150,4 +150,11 @@ config EXTCON_USB_GPIO > Say Y here to enable GPIO based USB cable detection extcon support. > Used typically if GPIO is used for USB ID pin detection. > > +config EXTCON_USBC_CROS_EC > + tristate "ChromeOS Embedded Controller EXTCON support" > + depends on MFD_CROS_EC > + help > + Say Y here to enable USB Type C cable detection extcon support when > + using Chrome OS EC based USB Type-C ports. > + > endif > diff --git a/drivers/extcon/Makefile b/drivers/extcon/Makefile > index ecfa958..a73624e 100644 > --- a/drivers/extcon/Makefile > +++ b/drivers/extcon/Makefile > @@ -20,3 +20,4 @@ obj-$(CONFIG_EXTCON_QCOM_SPMI_MISC) += > extcon-qcom-spmi-misc.o > obj-$(CONFIG_EXTCON_RT8973A) += extcon-rt8973a.o > obj-$(CONFIG_EXTCON_SM5502) += extcon-sm5502.o > obj-$(CONFIG_EXTCON_USB_GPIO)+= extcon-usb-gpio.o > +obj-$(CONFIG_EXTCON_USBC_CROS_EC) += extcon-usbc-cros-ec.o > diff --git a/drivers/extcon/extcon-usbc-cros-ec.c > b/drivers/extcon/extcon-usbc-cros-ec.c > new file mode 100644 > index 000..e759ed4 > --- /dev/null > +++ b/drivers/extcon/extcon-usbc-cros-ec.c > @@ -0,0 +1,415 @@ > +/** > + * drivers/extcon/extcon-usbc-cros-ec - ChromeOS Embedded Controller extcon > + * > + * Copyright (C) 2017 Google, Inc > + * Author: Benson Leung > + * > + * This software is licensed under the terms of the GNU General Public > + * License version 2, as published by the Free Software Foundation, and > + * may be copied, distributed, and modified under those terms. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +struct cros_ec_extcon_info { > + struct device *dev; > + struct extcon_dev *edev; > + > + int port_id; > + > + struct cros_ec_device *ec; > + > + struct notifier_block notifier; > + > + bool dp; /* DisplayPort enabled */ > + bool mux; /* SuperSpeed (usb3) enabled */ > + unsigned int power_type; > +}; > + > +static const unsigned int usb_type_c_cable[] = { > + EXTCON_DISP_DP, > + EXTCON_NONE, > +}; > + > +/** > + * cros_ec_pd_command() - Send a command to the EC. > + * @info: pointer to struct cros_ec_extcon_info > + * @command: EC command > + * @version: EC command version > + * @outdata: EC command output data > + * @outsize: Size of outdata > + * @indata: EC command input data > + * @insize: Size of indata > + * > + * Return: 0 on success, <0 on failure. > +