Changeset 44574


Ignore:
Timestamp:
2015-02-28T20:59:26+01:00 (3 years ago)
Author:
jogo
Message:

brcm63xx: fix gpio register usage

The driver expected data then dir, but both dts and legacy code passed
dir then data. Fix this by making the driver expect the registers in
ascending order, i.e. dir then data.

Signed-off-by: Jonas Gorski <jogo@…>

Location:
trunk/target/linux/brcm63xx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/brcm63xx/patches-3.14/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch

    r44565 r44574  
    8888+       struct bgpio_pdata *pdata = dev_get_platdata(dev); 
    8989+ 
    90 +       dat_r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 
    91 +       dirout_r = platform_get_resource(pdev, IORESOURCE_MEM, 1); 
     90+       dirout_r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 
     91+       dat_r = platform_get_resource(pdev, IORESOURCE_MEM, 1); 
    9292+       if (!dat_r || !dirout_r) 
    9393+               return -EINVAL; 
  • trunk/target/linux/brcm63xx/patches-3.14/375-MIPS-BCM63XX-switch-to-new-gpio-driver.patch

    r44565 r44574  
    101101+       res[0].flags = IORESOURCE_MEM; 
    102102+       res[0].start = bcm63xx_regset_address(RSET_GPIO); 
    103 +       res[0].start += data; 
     103+       res[0].start += dir; 
    104104  
    105105-       if (gpio >= chip->ngpio) 
     
    116116+       res[1].flags = IORESOURCE_MEM; 
    117117+       res[1].start = bcm63xx_regset_address(RSET_GPIO); 
    118 +       res[1].start += dir; 
     118+       res[1].start += data; 
    119119  
    120120-       return !!(bcm_gpio_readl(reg) & mask); 
     
    176176+               data_low_reg = GPIO_DATA_LO_REG; 
    177177  
    178 +       bcm63xx_gpio_init_one(0, data_low_reg, GPIO_CTL_LO_REG, min(ngpio, 32)); 
     178+       bcm63xx_gpio_init_one(0, GPIO_CTL_LO_REG, data_low_reg, min(ngpio, 32)); 
    179179  
    180180-static struct gpio_chip bcm63xx_gpio_chip = { 
     
    192192-{ 
    193193-       bcm63xx_gpio_out_low_reg_init(); 
    194 +       bcm63xx_gpio_init_one(1, GPIO_DATA_HI_REG, GPIO_CTL_HI_REG, ngpio - 32); 
     194+       bcm63xx_gpio_init_one(1, GPIO_CTL_HI_REG, GPIO_DATA_HI_REG, ngpio - 32); 
    195195  
    196196-       gpio_out_low = bcm_gpio_readl(gpio_out_low_reg); 
  • trunk/target/linux/brcm63xx/patches-3.18/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch

    r44565 r44574  
    8888+       struct bgpio_pdata *pdata = dev_get_platdata(dev); 
    8989+ 
    90 +       dat_r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 
    91 +       dirout_r = platform_get_resource(pdev, IORESOURCE_MEM, 1); 
     90+       dirout_r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 
     91+       dat_r = platform_get_resource(pdev, IORESOURCE_MEM, 1); 
    9292+       if (!dat_r || !dirout_r) 
    9393+               return -EINVAL; 
  • trunk/target/linux/brcm63xx/patches-3.18/375-MIPS-BCM63XX-switch-to-new-gpio-driver.patch

    r44565 r44574  
    101101+       res[0].flags = IORESOURCE_MEM; 
    102102+       res[0].start = bcm63xx_regset_address(RSET_GPIO); 
    103 +       res[0].start += data; 
     103+       res[0].start += dir; 
    104104  
    105105-       if (gpio >= chip->ngpio) 
     
    116116+       res[1].flags = IORESOURCE_MEM; 
    117117+       res[1].start = bcm63xx_regset_address(RSET_GPIO); 
    118 +       res[1].start += dir; 
     118+       res[1].start += data; 
    119119  
    120120-       return !!(bcm_gpio_readl(reg) & mask); 
     
    176176+               data_low_reg = GPIO_DATA_LO_REG; 
    177177  
    178 +       bcm63xx_gpio_init_one(0, data_low_reg, GPIO_CTL_LO_REG, min(ngpio, 32)); 
     178+       bcm63xx_gpio_init_one(0, GPIO_CTL_LO_REG, data_low_reg, min(ngpio, 32)); 
    179179  
    180180-static struct gpio_chip bcm63xx_gpio_chip = { 
     
    192192-{ 
    193193-       bcm63xx_gpio_out_low_reg_init(); 
    194 +       bcm63xx_gpio_init_one(1, GPIO_DATA_HI_REG, GPIO_CTL_HI_REG, ngpio - 32); 
     194+       bcm63xx_gpio_init_one(1, GPIO_CTL_HI_REG, GPIO_DATA_HI_REG, ngpio - 32); 
    195195  
    196196-       gpio_out_low = bcm_gpio_readl(gpio_out_low_reg); 
Note: See TracChangeset for help on using the changeset viewer.