Re: [PATCH v2 0/3] New driver for UCSI (USB Type-C)
On Fri, Jun 09, 2017 at 06:30:30AM -0700, Guenter Roeck wrote: > On 06/09/2017 04:03 AM, Heikki Krogerus wrote: > > Hi Guenter, > > > > On Mon, Jun 05, 2017 at 05:30:22PM +0300, Heikki Krogerus wrote: > > > Hi, > > > > > > This moves the current ucsi driver from drivers/usb/misc/ucsi.c to the > > > new USB Type-C class (drivers/usb/typec/). That allows us to finally do > > > role swapping. > > > > > > The driver is now split into core library part, and ACPI driver. That > > > should make it easy to add support for other interface methods (first > > > most likely being I2C) later if needed. > > > > > > Changes since v1: > > > - Added separate flag from pending ACK. Some new platforms generate > > > "command > > >complete" event on top of the normal "ACK complete" event with ACK > > > commands. > > >In such cases the driver has to be able to basically ignore the command > > >completion in case of ACK and only finish acknowledge routine when the > > > actual > > >ACK complete event is received. Otherwise a new command may be queued > > > to the > > >PPM before the previous has fully completed. > > > - Added an explanation why we are handling the PPM initialization in a > > > work as > > >suggested by Guenter. > > > - Fixed ucsi_reset_ppm() by removing possibility of returning -ETIMEDOUT > > > in case > > >of success right before the time expires. Suggested by Guenter. > > > - Replaced useless "goto err;" with "break;" in ucsi_run_command() as > > > suggested > > >by Guenter. > > > - Removed traceback in case of failure from ucsi_run_command() which is > > > not > > >necessary as suggested by Guenter. > > > - Highlighting the fact that the timeouts are in milliseconds by using _MS > > >ending with the definition (UCSI_TIMEOUT_MS and UCSI_SWAP_TIMEOUT_MS) > > > as > > >suggested by Guenter. > > > - Including also in ucsi.h as suggested by Guenter. > > > - In ucsi_acpi.c, explicitly pointing out in the comment that we can not > > > use > > >devm_ioremap_resource() as suggested by Guenter. > > > > > > > > > Heikki Krogerus (2): > > >usb: typec: Add support for UCSI interface > > >usb: typec: ucsi: Add ACPI driver > > > > Gentle ping. > > Are these OK now? > > > > I am far behind, sorry :-(. I'll try to get to it today or during the weekend. Thanks a lot Guenter! I really appreciate it. -- heikki -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 0/3] New driver for UCSI (USB Type-C)
On 06/09/2017 04:03 AM, Heikki Krogerus wrote: Hi Guenter, On Mon, Jun 05, 2017 at 05:30:22PM +0300, Heikki Krogerus wrote: Hi, This moves the current ucsi driver from drivers/usb/misc/ucsi.c to the new USB Type-C class (drivers/usb/typec/). That allows us to finally do role swapping. The driver is now split into core library part, and ACPI driver. That should make it easy to add support for other interface methods (first most likely being I2C) later if needed. Changes since v1: - Added separate flag from pending ACK. Some new platforms generate "command complete" event on top of the normal "ACK complete" event with ACK commands. In such cases the driver has to be able to basically ignore the command completion in case of ACK and only finish acknowledge routine when the actual ACK complete event is received. Otherwise a new command may be queued to the PPM before the previous has fully completed. - Added an explanation why we are handling the PPM initialization in a work as suggested by Guenter. - Fixed ucsi_reset_ppm() by removing possibility of returning -ETIMEDOUT in case of success right before the time expires. Suggested by Guenter. - Replaced useless "goto err;" with "break;" in ucsi_run_command() as suggested by Guenter. - Removed traceback in case of failure from ucsi_run_command() which is not necessary as suggested by Guenter. - Highlighting the fact that the timeouts are in milliseconds by using _MS ending with the definition (UCSI_TIMEOUT_MS and UCSI_SWAP_TIMEOUT_MS) as suggested by Guenter. - Including also in ucsi.h as suggested by Guenter. - In ucsi_acpi.c, explicitly pointing out in the comment that we can not use devm_ioremap_resource() as suggested by Guenter. Heikki Krogerus (2): usb: typec: Add support for UCSI interface usb: typec: ucsi: Add ACPI driver Gentle ping. Are these OK now? I am far behind, sorry :-(. I'll try to get to it today or during the weekend. Guenter -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 0/3] New driver for UCSI (USB Type-C)
Hi Guenter, On Mon, Jun 05, 2017 at 05:30:22PM +0300, Heikki Krogerus wrote: > Hi, > > This moves the current ucsi driver from drivers/usb/misc/ucsi.c to the > new USB Type-C class (drivers/usb/typec/). That allows us to finally do > role swapping. > > The driver is now split into core library part, and ACPI driver. That > should make it easy to add support for other interface methods (first > most likely being I2C) later if needed. > > Changes since v1: > - Added separate flag from pending ACK. Some new platforms generate "command > complete" event on top of the normal "ACK complete" event with ACK commands. > In such cases the driver has to be able to basically ignore the command > completion in case of ACK and only finish acknowledge routine when the > actual > ACK complete event is received. Otherwise a new command may be queued to the > PPM before the previous has fully completed. > - Added an explanation why we are handling the PPM initialization in a work as > suggested by Guenter. > - Fixed ucsi_reset_ppm() by removing possibility of returning -ETIMEDOUT in > case > of success right before the time expires. Suggested by Guenter. > - Replaced useless "goto err;" with "break;" in ucsi_run_command() as > suggested > by Guenter. > - Removed traceback in case of failure from ucsi_run_command() which is not > necessary as suggested by Guenter. > - Highlighting the fact that the timeouts are in milliseconds by using _MS > ending with the definition (UCSI_TIMEOUT_MS and UCSI_SWAP_TIMEOUT_MS) as > suggested by Guenter. > - Including also in ucsi.h as suggested by Guenter. > - In ucsi_acpi.c, explicitly pointing out in the comment that we can not use > devm_ioremap_resource() as suggested by Guenter. > > > Heikki Krogerus (2): > usb: typec: Add support for UCSI interface > usb: typec: ucsi: Add ACPI driver Gentle ping. Are these OK now? Thanks, -- heikki -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 0/3] New driver for UCSI (USB Type-C)
Hi, This moves the current ucsi driver from drivers/usb/misc/ucsi.c to the new USB Type-C class (drivers/usb/typec/). That allows us to finally do role swapping. The driver is now split into core library part, and ACPI driver. That should make it easy to add support for other interface methods (first most likely being I2C) later if needed. Changes since v1: - Added separate flag from pending ACK. Some new platforms generate "command complete" event on top of the normal "ACK complete" event with ACK commands. In such cases the driver has to be able to basically ignore the command completion in case of ACK and only finish acknowledge routine when the actual ACK complete event is received. Otherwise a new command may be queued to the PPM before the previous has fully completed. - Added an explanation why we are handling the PPM initialization in a work as suggested by Guenter. - Fixed ucsi_reset_ppm() by removing possibility of returning -ETIMEDOUT in case of success right before the time expires. Suggested by Guenter. - Replaced useless "goto err;" with "break;" in ucsi_run_command() as suggested by Guenter. - Removed traceback in case of failure from ucsi_run_command() which is not necessary as suggested by Guenter. - Highlighting the fact that the timeouts are in milliseconds by using _MS ending with the definition (UCSI_TIMEOUT_MS and UCSI_SWAP_TIMEOUT_MS) as suggested by Guenter. - Including also in ucsi.h as suggested by Guenter. - In ucsi_acpi.c, explicitly pointing out in the comment that we can not use devm_ioremap_resource() as suggested by Guenter. Heikki Krogerus (2): usb: typec: Add support for UCSI interface usb: typec: ucsi: Add ACPI driver drivers/usb/misc/Kconfig| 26 -- drivers/usb/misc/Makefile | 1 - drivers/usb/misc/ucsi.c | 478 --- drivers/usb/typec/Kconfig | 2 + drivers/usb/typec/Makefile | 1 + drivers/usb/typec/ucsi/Kconfig | 38 ++ drivers/usb/typec/ucsi/Makefile | 9 + drivers/usb/typec/ucsi/debug.h | 64 +++ drivers/usb/typec/ucsi/trace.c | 2 + drivers/usb/typec/ucsi/trace.h | 143 ++ drivers/usb/typec/ucsi/ucsi.c | 790 drivers/usb/{misc => typec/ucsi}/ucsi.h | 187 ++-- drivers/usb/typec/ucsi/ucsi_acpi.c | 158 +++ 13 files changed, 1358 insertions(+), 541 deletions(-) delete mode 100644 drivers/usb/misc/ucsi.c create mode 100644 drivers/usb/typec/ucsi/Kconfig create mode 100644 drivers/usb/typec/ucsi/Makefile create mode 100644 drivers/usb/typec/ucsi/debug.h create mode 100644 drivers/usb/typec/ucsi/trace.c create mode 100644 drivers/usb/typec/ucsi/trace.h create mode 100644 drivers/usb/typec/ucsi/ucsi.c rename drivers/usb/{misc => typec/ucsi}/ucsi.h (60%) create mode 100644 drivers/usb/typec/ucsi/ucsi_acpi.c -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html