From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965819AbcJYKxH (ORCPT ); Tue, 25 Oct 2016 06:53:07 -0400 Received: from mail-qk0-f177.google.com ([209.85.220.177]:35203 "EHLO mail-qk0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755604AbcJYKxE (ORCPT ); Tue, 25 Oct 2016 06:53:04 -0400 MIME-Version: 1.0 In-Reply-To: References: <20161024164634.4330-1-ahaslam@baylibre.com> <20161024164634.4330-13-ahaslam@baylibre.com> From: Axel Haslam Date: Tue, 25 Oct 2016 12:52:23 +0200 Message-ID: Subject: Re: [PATCH/RFT v2 12/17] USB: ochi-da8xx: Use a regulator for vbus/overcurrent To: Sekhar Nori Cc: Greg KH , Johan Hovold , robh+dt@kernel.org, Alan Stern , Kevin Hilman , Sergei Shtylyov , David Lechner , manjunath.goudar@linaro.org, Mark Brown , Alexandre Bailon , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 25, 2016 at 12:43 PM, Sekhar Nori wrote: > On Monday 24 October 2016 10:16 PM, ahaslam@baylibre.com wrote: >> From: Axel Haslam >> >> Currently, the da8xx ohci driver uses a set of gpios and callbacks in >> board files to handle vbus and overcurrent irqs form the power supply. >> However, this does not play nice when moving to a DT based boot were >> we wont have board files. >> >> Instead of requesting and handling the gpio, use the regulator framework >> to take care of enabling and disabling vbus power. This has the benefit >> that we dont need to pass any more platform data to the driver: >> >> These will be handled by the regulator framework: >> set_power -> regulator_enable/regulator_disable >> get_power -> regulator_is_enabled >> get_oci -> regulator_get_mode >> ocic_notify -> regulator notification >> >> We can keep the default potpgt and use the regulator start delay instead: >> potpgt -> regulator startup delay time >> >> The hawk board does not have a GPIO/OVERCURRENT gpio to control vbus, >> (they should not have been decleared/reserved) so, just remove those >> definitions from the hwk board file. >> >> Signed-off-by: Axel Haslam >> --- >> arch/arm/mach-davinci/board-da830-evm.c | 97 ++++++++---------------- >> arch/arm/mach-davinci/board-omapl138-hawk.c | 96 +----------------------- >> arch/arm/mach-davinci/include/mach/da8xx.h | 2 +- >> arch/arm/mach-davinci/usb-da8xx.c | 3 +- >> drivers/usb/host/ohci-da8xx.c | 111 ++++++++++++++++++---------- >> include/linux/platform_data/usb-davinci.h | 19 ----- >> 6 files changed, 105 insertions(+), 223 deletions(-) > > Can you separate out the driver enhancement from the platform > (mach-davinci) changes? They need to go through different trees. > Ok, i will do that, (it might require intermediate code to have the driver working on each patch) > Thanks, > Sekhar > > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Axel Haslam Subject: Re: [PATCH/RFT v2 12/17] USB: ochi-da8xx: Use a regulator for vbus/overcurrent Date: Tue, 25 Oct 2016 12:52:23 +0200 Message-ID: References: <20161024164634.4330-1-ahaslam@baylibre.com> <20161024164634.4330-13-ahaslam@baylibre.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: Sender: linux-usb-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Sekhar Nori Cc: Greg KH , Johan Hovold , robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, Alan Stern , Kevin Hilman , Sergei Shtylyov , David Lechner , manjunath.goudar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, Mark Brown , Alexandre Bailon , linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: devicetree@vger.kernel.org On Tue, Oct 25, 2016 at 12:43 PM, Sekhar Nori wrote: > On Monday 24 October 2016 10:16 PM, ahaslam-rdvid1DuHRBWk0Htik3J/w@public.gmane.org wrote: >> From: Axel Haslam >> >> Currently, the da8xx ohci driver uses a set of gpios and callbacks in >> board files to handle vbus and overcurrent irqs form the power supply. >> However, this does not play nice when moving to a DT based boot were >> we wont have board files. >> >> Instead of requesting and handling the gpio, use the regulator framework >> to take care of enabling and disabling vbus power. This has the benefit >> that we dont need to pass any more platform data to the driver: >> >> These will be handled by the regulator framework: >> set_power -> regulator_enable/regulator_disable >> get_power -> regulator_is_enabled >> get_oci -> regulator_get_mode >> ocic_notify -> regulator notification >> >> We can keep the default potpgt and use the regulator start delay instead: >> potpgt -> regulator startup delay time >> >> The hawk board does not have a GPIO/OVERCURRENT gpio to control vbus, >> (they should not have been decleared/reserved) so, just remove those >> definitions from the hwk board file. >> >> Signed-off-by: Axel Haslam >> --- >> arch/arm/mach-davinci/board-da830-evm.c | 97 ++++++++---------------- >> arch/arm/mach-davinci/board-omapl138-hawk.c | 96 +----------------------- >> arch/arm/mach-davinci/include/mach/da8xx.h | 2 +- >> arch/arm/mach-davinci/usb-da8xx.c | 3 +- >> drivers/usb/host/ohci-da8xx.c | 111 ++++++++++++++++++---------- >> include/linux/platform_data/usb-davinci.h | 19 ----- >> 6 files changed, 105 insertions(+), 223 deletions(-) > > Can you separate out the driver enhancement from the platform > (mach-davinci) changes? They need to go through different trees. > Ok, i will do that, (it might require intermediate code to have the driver working on each patch) > Thanks, > Sekhar > > -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: ahaslam@baylibre.com (Axel Haslam) Date: Tue, 25 Oct 2016 12:52:23 +0200 Subject: [PATCH/RFT v2 12/17] USB: ochi-da8xx: Use a regulator for vbus/overcurrent In-Reply-To: References: <20161024164634.4330-1-ahaslam@baylibre.com> <20161024164634.4330-13-ahaslam@baylibre.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tue, Oct 25, 2016 at 12:43 PM, Sekhar Nori wrote: > On Monday 24 October 2016 10:16 PM, ahaslam at baylibre.com wrote: >> From: Axel Haslam >> >> Currently, the da8xx ohci driver uses a set of gpios and callbacks in >> board files to handle vbus and overcurrent irqs form the power supply. >> However, this does not play nice when moving to a DT based boot were >> we wont have board files. >> >> Instead of requesting and handling the gpio, use the regulator framework >> to take care of enabling and disabling vbus power. This has the benefit >> that we dont need to pass any more platform data to the driver: >> >> These will be handled by the regulator framework: >> set_power -> regulator_enable/regulator_disable >> get_power -> regulator_is_enabled >> get_oci -> regulator_get_mode >> ocic_notify -> regulator notification >> >> We can keep the default potpgt and use the regulator start delay instead: >> potpgt -> regulator startup delay time >> >> The hawk board does not have a GPIO/OVERCURRENT gpio to control vbus, >> (they should not have been decleared/reserved) so, just remove those >> definitions from the hwk board file. >> >> Signed-off-by: Axel Haslam >> --- >> arch/arm/mach-davinci/board-da830-evm.c | 97 ++++++++---------------- >> arch/arm/mach-davinci/board-omapl138-hawk.c | 96 +----------------------- >> arch/arm/mach-davinci/include/mach/da8xx.h | 2 +- >> arch/arm/mach-davinci/usb-da8xx.c | 3 +- >> drivers/usb/host/ohci-da8xx.c | 111 ++++++++++++++++++---------- >> include/linux/platform_data/usb-davinci.h | 19 ----- >> 6 files changed, 105 insertions(+), 223 deletions(-) > > Can you separate out the driver enhancement from the platform > (mach-davinci) changes? They need to go through different trees. > Ok, i will do that, (it might require intermediate code to have the driver working on each patch) > Thanks, > Sekhar > >