Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6

Pull a few more GPIO bug fixes from Grant Likely:
"Oops, missed a couple. Here's an updated pull req for GPIO"

A set of PCH bug fixes, and one patch to fix up compile warnings

* tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6:
gpio/exynos: Fix compiler warnings when non-exynos machines are selected
gpio: pch9: Use proper flow type handlers

+40 -35
+28 -29
drivers/gpio/gpio-pch.c
··· 230 231 static int pch_irq_type(struct irq_data *d, unsigned int type) 232 { 233 - u32 im; 234 - u32 __iomem *im_reg; 235 - u32 ien; 236 - u32 im_pos; 237 - int ch; 238 - unsigned long flags; 239 - u32 val; 240 - int irq = d->irq; 241 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 242 struct pch_gpio *chip = gc->private; 243 244 ch = irq - chip->irq_base; 245 if (irq <= chip->irq_base + 7) { ··· 266 case IRQ_TYPE_LEVEL_LOW: 267 val = PCH_LEVEL_L; 268 break; 269 - case IRQ_TYPE_PROBE: 270 - goto end; 271 default: 272 - dev_warn(chip->dev, "%s: unknown type(%dd)", 273 - __func__, type); 274 - goto end; 275 } 276 277 /* Set interrupt mode */ 278 im = ioread32(im_reg) & ~(PCH_IM_MASK << (im_pos * 4)); 279 iowrite32(im | (val << (im_pos * 4)), im_reg); 280 281 - /* iclr */ 282 - iowrite32(BIT(ch), &chip->reg->iclr); 283 284 - /* IMASKCLR */ 285 - iowrite32(BIT(ch), &chip->reg->imaskclr); 286 - 287 - /* Enable interrupt */ 288 - ien = ioread32(&chip->reg->ien); 289 - iowrite32(ien | BIT(ch), &chip->reg->ien); 290 - end: 291 spin_unlock_irqrestore(&chip->spinlock, flags); 292 - 293 return 0; 294 } 295 ··· 301 iowrite32(1 << (d->irq - chip->irq_base), &chip->reg->imask); 302 } 303 304 static irqreturn_t pch_gpio_handler(int irq, void *dev_id) 305 { 306 struct pch_gpio *chip = dev_id; 307 u32 reg_val = ioread32(&chip->reg->istatus); 308 - int i; 309 - int ret = IRQ_NONE; 310 311 for (i = 0; i < gpio_pins[chip->ioh]; i++) { 312 if (reg_val & BIT(i)) { 313 dev_dbg(chip->dev, "%s:[%d]:irq=%d status=0x%x\n", 314 __func__, i, irq, reg_val); 315 - iowrite32(BIT(i), &chip->reg->iclr); 316 generic_handle_irq(chip->irq_base + i); 317 ret = IRQ_HANDLED; 318 } ··· 337 gc->private = chip; 338 ct = gc->chip_types; 339 340 ct->chip.irq_mask = pch_irq_mask; 341 ct->chip.irq_unmask = pch_irq_unmask; 342 ct->chip.irq_set_type = pch_irq_type; ··· 352 s32 ret; 353 struct pch_gpio *chip; 354 int irq_base; 355 356 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 357 if (chip == NULL) ··· 404 } 405 chip->irq_base = irq_base; 406 407 ret = request_irq(pdev->irq, pch_gpio_handler, 408 - IRQF_SHARED, KBUILD_MODNAME, chip); 409 if (ret != 0) { 410 dev_err(&pdev->dev, 411 "%s request_irq failed\n", __func__); ··· 419 420 pch_gpio_alloc_generic_chip(chip, irq_base, gpio_pins[chip->ioh]); 421 422 - /* Initialize interrupt ien register */ 423 - iowrite32(0, &chip->reg->ien); 424 end: 425 return 0; 426
··· 230 231 static int pch_irq_type(struct irq_data *d, unsigned int type) 232 { 233 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 234 struct pch_gpio *chip = gc->private; 235 + u32 im, im_pos, val; 236 + u32 __iomem *im_reg; 237 + unsigned long flags; 238 + int ch, irq = d->irq; 239 240 ch = irq - chip->irq_base; 241 if (irq <= chip->irq_base + 7) { ··· 270 case IRQ_TYPE_LEVEL_LOW: 271 val = PCH_LEVEL_L; 272 break; 273 default: 274 + goto unlock; 275 } 276 277 /* Set interrupt mode */ 278 im = ioread32(im_reg) & ~(PCH_IM_MASK << (im_pos * 4)); 279 iowrite32(im | (val << (im_pos * 4)), im_reg); 280 281 + /* And the handler */ 282 + if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH)) 283 + __irq_set_handler_locked(d->irq, handle_level_irq); 284 + else if (type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) 285 + __irq_set_handler_locked(d->irq, handle_edge_irq); 286 287 + unlock: 288 spin_unlock_irqrestore(&chip->spinlock, flags); 289 return 0; 290 } 291 ··· 313 iowrite32(1 << (d->irq - chip->irq_base), &chip->reg->imask); 314 } 315 316 + static void pch_irq_ack(struct irq_data *d) 317 + { 318 + struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 319 + struct pch_gpio *chip = gc->private; 320 + 321 + iowrite32(1 << (d->irq - chip->irq_base), &chip->reg->iclr); 322 + } 323 + 324 static irqreturn_t pch_gpio_handler(int irq, void *dev_id) 325 { 326 struct pch_gpio *chip = dev_id; 327 u32 reg_val = ioread32(&chip->reg->istatus); 328 + int i, ret = IRQ_NONE; 329 330 for (i = 0; i < gpio_pins[chip->ioh]; i++) { 331 if (reg_val & BIT(i)) { 332 dev_dbg(chip->dev, "%s:[%d]:irq=%d status=0x%x\n", 333 __func__, i, irq, reg_val); 334 generic_handle_irq(chip->irq_base + i); 335 ret = IRQ_HANDLED; 336 } ··· 343 gc->private = chip; 344 ct = gc->chip_types; 345 346 + ct->chip.irq_ack = pch_irq_ack; 347 ct->chip.irq_mask = pch_irq_mask; 348 ct->chip.irq_unmask = pch_irq_unmask; 349 ct->chip.irq_set_type = pch_irq_type; ··· 357 s32 ret; 358 struct pch_gpio *chip; 359 int irq_base; 360 + u32 msk; 361 362 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 363 if (chip == NULL) ··· 408 } 409 chip->irq_base = irq_base; 410 411 + /* Mask all interrupts, but enable them */ 412 + msk = (1 << gpio_pins[chip->ioh]) - 1; 413 + iowrite32(msk, &chip->reg->imask); 414 + iowrite32(msk, &chip->reg->ien); 415 + 416 ret = request_irq(pdev->irq, pch_gpio_handler, 417 + IRQF_SHARED, KBUILD_MODNAME, chip); 418 if (ret != 0) { 419 dev_err(&pdev->dev, 420 "%s request_irq failed\n", __func__); ··· 418 419 pch_gpio_alloc_generic_chip(chip, irq_base, gpio_pins[chip->ioh]); 420 421 end: 422 return 0; 423
+12 -6
drivers/gpio/gpio-samsung.c
··· 452 }; 453 #endif 454 455 static struct samsung_gpio_cfg exynos_gpio_cfg = { 456 .set_pull = exynos_gpio_setpull, 457 .get_pull = exynos_gpio_getpull, 458 .set_config = samsung_gpio_setcfg_4bit, 459 .get_config = samsung_gpio_getcfg_4bit, 460 }; 461 462 #if defined(CONFIG_CPU_S5P6440) || defined(CONFIG_CPU_S5P6450) 463 static struct samsung_gpio_cfg s5p64x0_gpio_cfg_rbank = { ··· 2125 * uses the above macro and depends on the banks being listed in order here. 2126 */ 2127 2128 - static struct samsung_gpio_chip exynos4_gpios_1[] = { 2129 #ifdef CONFIG_ARCH_EXYNOS4 2130 { 2131 .chip = { 2132 .base = EXYNOS4_GPA0(0), ··· 2224 .label = "GPF3", 2225 }, 2226 }, 2227 - #endif 2228 }; 2229 2230 - static struct samsung_gpio_chip exynos4_gpios_2[] = { 2231 #ifdef CONFIG_ARCH_EXYNOS4 2232 { 2233 .chip = { 2234 .base = EXYNOS4_GPJ0(0), ··· 2369 .to_irq = samsung_gpiolib_to_irq, 2370 }, 2371 }, 2372 - #endif 2373 }; 2374 2375 - static struct samsung_gpio_chip exynos4_gpios_3[] = { 2376 #ifdef CONFIG_ARCH_EXYNOS4 2377 { 2378 .chip = { 2379 .base = EXYNOS4_GPZ(0), ··· 2381 .label = "GPZ", 2382 }, 2383 }, 2384 - #endif 2385 }; 2386 2387 #ifdef CONFIG_ARCH_EXYNOS5 2388 static struct samsung_gpio_chip exynos5_gpios_1[] = { ··· 2721 { 2722 struct samsung_gpio_chip *chip; 2723 int i, nr_chips; 2724 void __iomem *gpio_base1, *gpio_base2, *gpio_base3, *gpio_base4; 2725 int group = 0; 2726 2727 samsung_gpiolib_set_cfg(samsung_gpio_cfgs, ARRAY_SIZE(samsung_gpio_cfgs)); ··· 2975 2976 return 0; 2977 2978 err_ioremap4: 2979 iounmap(gpio_base3); 2980 err_ioremap3: ··· 2984 iounmap(gpio_base1); 2985 err_ioremap1: 2986 return -ENOMEM; 2987 } 2988 core_initcall(samsung_gpiolib_init); 2989
··· 452 }; 453 #endif 454 455 + #if defined(CONFIG_ARCH_EXYNOS4) || defined(CONFIG_ARCH_EXYNOS5) 456 static struct samsung_gpio_cfg exynos_gpio_cfg = { 457 .set_pull = exynos_gpio_setpull, 458 .get_pull = exynos_gpio_getpull, 459 .set_config = samsung_gpio_setcfg_4bit, 460 .get_config = samsung_gpio_getcfg_4bit, 461 }; 462 + #endif 463 464 #if defined(CONFIG_CPU_S5P6440) || defined(CONFIG_CPU_S5P6450) 465 static struct samsung_gpio_cfg s5p64x0_gpio_cfg_rbank = { ··· 2123 * uses the above macro and depends on the banks being listed in order here. 2124 */ 2125 2126 #ifdef CONFIG_ARCH_EXYNOS4 2127 + static struct samsung_gpio_chip exynos4_gpios_1[] = { 2128 { 2129 .chip = { 2130 .base = EXYNOS4_GPA0(0), ··· 2222 .label = "GPF3", 2223 }, 2224 }, 2225 }; 2226 + #endif 2227 2228 #ifdef CONFIG_ARCH_EXYNOS4 2229 + static struct samsung_gpio_chip exynos4_gpios_2[] = { 2230 { 2231 .chip = { 2232 .base = EXYNOS4_GPJ0(0), ··· 2367 .to_irq = samsung_gpiolib_to_irq, 2368 }, 2369 }, 2370 }; 2371 + #endif 2372 2373 #ifdef CONFIG_ARCH_EXYNOS4 2374 + static struct samsung_gpio_chip exynos4_gpios_3[] = { 2375 { 2376 .chip = { 2377 .base = EXYNOS4_GPZ(0), ··· 2379 .label = "GPZ", 2380 }, 2381 }, 2382 }; 2383 + #endif 2384 2385 #ifdef CONFIG_ARCH_EXYNOS5 2386 static struct samsung_gpio_chip exynos5_gpios_1[] = { ··· 2719 { 2720 struct samsung_gpio_chip *chip; 2721 int i, nr_chips; 2722 + #if defined(CONFIG_CPU_EXYNOS4210) || defined(CONFIG_SOC_EXYNOS5250) 2723 void __iomem *gpio_base1, *gpio_base2, *gpio_base3, *gpio_base4; 2724 + #endif 2725 int group = 0; 2726 2727 samsung_gpiolib_set_cfg(samsung_gpio_cfgs, ARRAY_SIZE(samsung_gpio_cfgs)); ··· 2971 2972 return 0; 2973 2974 + #if defined(CONFIG_CPU_EXYNOS4210) || defined(CONFIG_SOC_EXYNOS5250) 2975 err_ioremap4: 2976 iounmap(gpio_base3); 2977 err_ioremap3: ··· 2979 iounmap(gpio_base1); 2980 err_ioremap1: 2981 return -ENOMEM; 2982 + #endif 2983 } 2984 core_initcall(samsung_gpiolib_init); 2985