This also greatly simplifies the power_{on,off} callbacks and make them
work on platform device id instead of checking the OHCI controller base
address like what was done in ohci-au1xxx.c.
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
arch/mips/alchemy/common/platform.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
@@ -142,6 +143,34 @@ static struct usb_ehci_pdata alchemy_ehci_pdata = {.power_suspend=alchemy_ehci_power_off,};+/* Power on callback for the ohci platform driver */+staticintalchemy_ohci_power_on(structplatform_device*pdev)+{+intunit;++unit=(pdev->id==1)?+ALCHEMY_USB_OHCI1:ALCHEMY_USB_OHCI0;++returnalchemy_usb_control(unit,1);+}++/* Power off/suspend callback for the ohci platform driver */+staticvoidalchemy_ohci_power_off(structplatform_device*pdev)+{+intunit;++unit=(pdev->id==1)?+ALCHEMY_USB_OHCI1:ALCHEMY_USB_OHCI0;++alchemy_usb_control(unit,0);+}++staticstructusb_ohci_pdataalchemy_ohci_pdata={+.power_on=alchemy_ohci_power_on,+.power_off=alchemy_ohci_power_off,+.power_suspend=alchemy_ohci_power_off,+};+staticunsignedlongalchemy_ohci_data[][2]__initdata={[ALCHEMY_CPU_AU1000]={AU1000_USB_OHCI_PHYS_ADDR,AU1000_USB_HOST_INT},[ALCHEMY_CPU_AU1500]={AU1000_USB_OHCI_PHYS_ADDR,AU1500_USB_HOST_INT},
From: Manuel Lauss <manuel.lauss@gmail.com> Date: 2012-10-03 15:22:21
On Wed, Oct 3, 2012 at 5:03 PM, Florian Fainelli [off-list ref] wrote:
This also greatly simplifies the power_{on,off} callbacks and make them
work on platform device id instead of checking the OHCI controller base
address like what was done in ohci-au1xxx.c.
That was by design -- the base address is far more reliable in identifying the
correct controller instance than the platform device id. There are systems
in the field which don't use the alchemy/common/platform.c file at all.
Manuel
On Wednesday 03 October 2012 17:21:37 Manuel Lauss wrote:
On Wed, Oct 3, 2012 at 5:03 PM, Florian Fainelli [off-list ref] wrote:
quoted
This also greatly simplifies the power_{on,off} callbacks and make them
work on platform device id instead of checking the OHCI controller base
address like what was done in ohci-au1xxx.c.
That was by design -- the base address is far more reliable in identifying
the
correct controller instance than the platform device id. There are systems
in the field which don't use the alchemy/common/platform.c file at all.
Fair enough, but the way it was done previously was very error-prone if the
base address changed for any reason in the platform code, and you did not
notice it had to be changed in the OHCI driver too, then it simply did not
work. By systems in the field you mean out of tree users? If so, I'd say that
it's up to you to get them maintained or merged.
--
Florian
From: Manuel Lauss <manuel.lauss@gmail.com> Date: 2012-10-03 15:27:34
On Wed, Oct 3, 2012 at 5:24 PM, Florian Fainelli [off-list ref] wrote:
On Wednesday 03 October 2012 17:21:37 Manuel Lauss wrote:
quoted
On Wed, Oct 3, 2012 at 5:03 PM, Florian Fainelli [off-list ref] wrote:
quoted
This also greatly simplifies the power_{on,off} callbacks and make them
work on platform device id instead of checking the OHCI controller base
address like what was done in ohci-au1xxx.c.
That was by design -- the base address is far more reliable in identifying
the
quoted
correct controller instance than the platform device id. There are systems
in the field which don't use the alchemy/common/platform.c file at all.
Fair enough, but the way it was done previously was very error-prone if the
base address changed for any reason in the platform code, and you did not
notice it had to be changed in the OHCI driver too, then it simply did not
Since the Alchemy line is dead this point is moot.
work. By systems in the field you mean out of tree users? If so, I'd say that
it's up to you to get them maintained or merged.
I'm not against the patch at all, quite the contrary.
Manuel
From: Manuel Lauss <manuel.lauss@gmail.com> Date: 2012-10-03 16:08:11
On Wed, Oct 3, 2012 at 5:03 PM, Florian Fainelli [off-list ref] wrote:
quoted hunk
This also greatly simplifies the power_{on,off} callbacks and make them
work on platform device id instead of checking the OHCI controller base
address like what was done in ohci-au1xxx.c.
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
arch/mips/alchemy/common/platform.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
@@ -142,6 +143,34 @@ static struct usb_ehci_pdata alchemy_ehci_pdata = {.power_suspend=alchemy_ehci_power_off,};+/* Power on callback for the ohci platform driver */+staticintalchemy_ohci_power_on(structplatform_device*pdev)+{+intunit;++unit=(pdev->id==1)?+ALCHEMY_USB_OHCI1:ALCHEMY_USB_OHCI0;++returnalchemy_usb_control(unit,1);+}++/* Power off/suspend callback for the ohci platform driver */+staticvoidalchemy_ohci_power_off(structplatform_device*pdev)+{+intunit;++unit=(pdev->id==1)?+ALCHEMY_USB_OHCI1:ALCHEMY_USB_OHCI0;++alchemy_usb_control(unit,0);+}++staticstructusb_ohci_pdataalchemy_ohci_pdata={+.power_on=alchemy_ohci_power_on,+.power_off=alchemy_ohci_power_off,+.power_suspend=alchemy_ohci_power_off,+};+staticunsignedlongalchemy_ohci_data[][2]__initdata={[ALCHEMY_CPU_AU1000]={AU1000_USB_OHCI_PHYS_ADDR,AU1000_USB_HOST_INT},[ALCHEMY_CPU_AU1500]={AU1000_USB_OHCI_PHYS_ADDR,AU1500_USB_HOST_INT},
Should be "ohci-platform" (2x). With this change USB works on all my
Alchemy boards.
I'd also suggest to move drivers/usb/host/alchemy-common.c to
arch/mips/alchemy/common/usb.c.
(same for octeon2-common.c)
Manuel
On Wednesday 03 October 2012 18:07:28 Manuel Lauss wrote:
On Wed, Oct 3, 2012 at 5:03 PM, Florian Fainelli [off-list ref] wrote:
quoted
This also greatly simplifies the power_{on,off} callbacks and make them
work on platform device id instead of checking the OHCI controller base
address like what was done in ohci-au1xxx.c.
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
arch/mips/alchemy/common/platform.c | 31
@@ -142,6 +143,34 @@ static struct usb_ehci_pdata alchemy_ehci_pdata = {.power_suspend=alchemy_ehci_power_off,};+/* Power on callback for the ohci platform driver */+staticintalchemy_ohci_power_on(structplatform_device*pdev)+{+intunit;++unit=(pdev->id==1)?+ALCHEMY_USB_OHCI1:ALCHEMY_USB_OHCI0;++returnalchemy_usb_control(unit,1);+}++/* Power off/suspend callback for the ohci platform driver */+staticvoidalchemy_ohci_power_off(structplatform_device*pdev)+{+intunit;++unit=(pdev->id==1)?+ALCHEMY_USB_OHCI1:ALCHEMY_USB_OHCI0;++alchemy_usb_control(unit,0);+}++staticstructusb_ohci_pdataalchemy_ohci_pdata={+.power_on=alchemy_ohci_power_on,+.power_off=alchemy_ohci_power_off,+.power_suspend=alchemy_ohci_power_off,+};+staticunsignedlongalchemy_ohci_data[][2]__initdata={[ALCHEMY_CPU_AU1000]={AU1000_USB_OHCI_PHYS_ADDR,