Changeset 36309


Ignore:
Timestamp:
2013-04-10T18:20:50+02:00 (5 years ago)
Author:
nbd
Message:

cns3xxx: fix USB ehci/ohci platform driver

Update ehci/ohci driver registration to conform to the new platform
drivers.

This fixes missing USB host support in 3.8.x

Signed-off-by: Tim Harvey <tharvey@…>

Location:
trunk/target/linux/cns3xxx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c

    r36241 r36309  
    1010 * Copyright 2011 Gateworks Corporation 
    1111 *                Chris Lang <clang@gateworks.com> 
    12  * Copyright 2012 Gateworks Corporation 
     12 * Copyright 2012-2013 Gateworks Corporation 
    1313 *                Tim Harvey <tharvey@gateworks.com> 
    1414 * 
     
    3838#include <linux/if_ether.h> 
    3939#include <linux/pps-gpio.h> 
     40#include <linux/usb/ehci_pdriver.h> 
     41#include <linux/usb/ohci_pdriver.h> 
    4042#include <asm/setup.h> 
    4143#include <asm/mach-types.h> 
     
    415417static u64 cns3xxx_usb_ehci_dma_mask = DMA_BIT_MASK(32); 
    416418 
     419static int csn3xxx_usb_power_on(struct platform_device *pdev) 
     420{ 
     421        /* 
     422         * EHCI and OHCI share the same clock and power, 
     423         * resetting twice would cause the 1st controller been reset. 
     424         * Therefore only do power up  at the first up device, and 
     425         * power down at the last down device. 
     426         * 
     427         * Set USB AHB INCR length to 16 
     428         */ 
     429        if (atomic_inc_return(&usb_pwr_ref) == 1) { 
     430                cns3xxx_pwr_power_up(1 << PM_PLL_HM_PD_CTRL_REG_OFFSET_PLL_USB); 
     431                cns3xxx_pwr_clk_en(1 << PM_CLK_GATE_REG_OFFSET_USB_HOST); 
     432                cns3xxx_pwr_soft_rst(1 << PM_SOFT_RST_REG_OFFST_USB_HOST); 
     433                __raw_writel((__raw_readl(MISC_CHIP_CONFIG_REG) | (0X2 << 24)), 
     434                        MISC_CHIP_CONFIG_REG); 
     435        } 
     436 
     437        return 0; 
     438} 
     439 
     440static void csn3xxx_usb_power_off(struct platform_device *pdev) 
     441{ 
     442        /* 
     443         * EHCI and OHCI share the same clock and power, 
     444         * resetting twice would cause the 1st controller been reset. 
     445         * Therefore only do power up  at the first up device, and 
     446         * power down at the last down device. 
     447         */ 
     448        if (atomic_dec_return(&usb_pwr_ref) == 0) 
     449                cns3xxx_pwr_clk_dis(1 << PM_CLK_GATE_REG_OFFSET_USB_HOST); 
     450} 
     451 
     452static struct usb_ehci_pdata cns3xxx_usb_ehci_pdata = { 
     453        .power_on       = csn3xxx_usb_power_on, 
     454        .power_off      = csn3xxx_usb_power_off, 
     455}; 
     456 
    417457static struct platform_device cns3xxx_usb_ehci_device = { 
    418         .name          = "cns3xxx-ehci", 
     458        .name          = "ehci-platform", 
    419459        .num_resources = ARRAY_SIZE(cns3xxx_usb_ehci_resources), 
    420460        .resource      = cns3xxx_usb_ehci_resources, 
     
    422462                .dma_mask          = &cns3xxx_usb_ehci_dma_mask, 
    423463                .coherent_dma_mask = DMA_BIT_MASK(32), 
     464                .platform_data     = &cns3xxx_usb_ehci_pdata, 
    424465        }, 
    425466}; 
     
    439480static u64 cns3xxx_usb_ohci_dma_mask = DMA_BIT_MASK(32); 
    440481 
     482static struct usb_ohci_pdata cns3xxx_usb_ohci_pdata = { 
     483        .num_ports      = 1, 
     484        .power_on       = csn3xxx_usb_power_on, 
     485        .power_off      = csn3xxx_usb_power_off, 
     486}; 
     487 
    441488static struct platform_device cns3xxx_usb_ohci_device = { 
    442         .name          = "cns3xxx-ohci", 
     489        .name          = "ohci-platform", 
    443490        .num_resources = ARRAY_SIZE(cns3xxx_usb_ohci_resources), 
    444491        .resource      = cns3xxx_usb_ohci_resources, 
     
    446493                .dma_mask          = &cns3xxx_usb_ohci_dma_mask, 
    447494                .coherent_dma_mask = DMA_BIT_MASK(32), 
     495                .platform_data     = &cns3xxx_usb_ohci_pdata, 
    448496        }, 
    449497}; 
  • trunk/target/linux/cns3xxx/patches-3.8/025-smp_support.patch

    r36241 r36309  
    2929--- a/arch/arm/mach-cns3xxx/laguna.c 
    3030+++ b/arch/arm/mach-cns3xxx/laguna.c 
    31 @@ -941,6 +941,7 @@ static int __init laguna_model_setup(voi 
     31@@ -989,6 +989,7 @@ static int __init laguna_model_setup(voi 
    3232 late_initcall(laguna_model_setup); 
    3333  
Note: See TracChangeset for help on using the changeset viewer.