Searched refs:sgpio (Results 1 - 6 of 6) sorted by relevance

/linux-4.1.27/drivers/pinctrl/sirf/
H A Dpinctrl-sirf.c408 sirfsoc_gpio_to_bank(struct sirfsoc_gpio_chip *sgpio, unsigned int offset) sirfsoc_gpio_to_bank() argument
410 return &sgpio->sgpio_bank[offset / SIRFSOC_GPIO_BANK_SIZE]; sirfsoc_gpio_to_bank()
421 struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(gc); sirfsoc_gpio_irq_ack() local
422 struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, d->hwirq); sirfsoc_gpio_irq_ack()
429 spin_lock_irqsave(&sgpio->lock, flags); sirfsoc_gpio_irq_ack()
431 val = readl(sgpio->chip.regs + offset); sirfsoc_gpio_irq_ack()
433 writel(val, sgpio->chip.regs + offset); sirfsoc_gpio_irq_ack()
435 spin_unlock_irqrestore(&sgpio->lock, flags); sirfsoc_gpio_irq_ack()
438 static void __sirfsoc_gpio_irq_mask(struct sirfsoc_gpio_chip *sgpio, __sirfsoc_gpio_irq_mask() argument
447 spin_lock_irqsave(&sgpio->lock, flags); __sirfsoc_gpio_irq_mask()
449 val = readl(sgpio->chip.regs + offset); __sirfsoc_gpio_irq_mask()
452 writel(val, sgpio->chip.regs + offset); __sirfsoc_gpio_irq_mask()
454 spin_unlock_irqrestore(&sgpio->lock, flags); __sirfsoc_gpio_irq_mask()
460 struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(gc); sirfsoc_gpio_irq_mask() local
461 struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, d->hwirq); sirfsoc_gpio_irq_mask()
463 __sirfsoc_gpio_irq_mask(sgpio, bank, d->hwirq % SIRFSOC_GPIO_BANK_SIZE); sirfsoc_gpio_irq_mask()
469 struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(gc); sirfsoc_gpio_irq_unmask() local
470 struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, d->hwirq); sirfsoc_gpio_irq_unmask()
477 spin_lock_irqsave(&sgpio->lock, flags); sirfsoc_gpio_irq_unmask()
479 val = readl(sgpio->chip.regs + offset); sirfsoc_gpio_irq_unmask()
482 writel(val, sgpio->chip.regs + offset); sirfsoc_gpio_irq_unmask()
484 spin_unlock_irqrestore(&sgpio->lock, flags); sirfsoc_gpio_irq_unmask()
490 struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(gc); sirfsoc_gpio_irq_type() local
491 struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, d->hwirq); sirfsoc_gpio_irq_type()
498 spin_lock_irqsave(&sgpio->lock, flags); sirfsoc_gpio_irq_type()
500 val = readl(sgpio->chip.regs + offset); sirfsoc_gpio_irq_type()
533 writel(val, sgpio->chip.regs + offset); sirfsoc_gpio_irq_type()
535 spin_unlock_irqrestore(&sgpio->lock, flags); sirfsoc_gpio_irq_type()
551 struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(gc); sirfsoc_gpio_handle_irq() local
559 bank = &sgpio->sgpio_bank[i]; sirfsoc_gpio_handle_irq()
567 status = readl(sgpio->chip.regs + SIRFSOC_GPIO_INT_STATUS(bank->id)); sirfsoc_gpio_handle_irq()
577 ctrl = readl(sgpio->chip.regs + SIRFSOC_GPIO_CTRL(bank->id, idx)); sirfsoc_gpio_handle_irq()
597 static inline void sirfsoc_gpio_set_input(struct sirfsoc_gpio_chip *sgpio, sirfsoc_gpio_set_input() argument
602 val = readl(sgpio->chip.regs + ctrl_offset); sirfsoc_gpio_set_input()
604 writel(val, sgpio->chip.regs + ctrl_offset); sirfsoc_gpio_set_input()
609 struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(chip); sirfsoc_gpio_request() local
610 struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, offset); sirfsoc_gpio_request()
622 sirfsoc_gpio_set_input(sgpio, SIRFSOC_GPIO_CTRL(bank->id, offset)); sirfsoc_gpio_request()
623 __sirfsoc_gpio_irq_mask(sgpio, bank, offset); sirfsoc_gpio_request()
632 struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(chip); sirfsoc_gpio_free() local
633 struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, offset); sirfsoc_gpio_free()
638 __sirfsoc_gpio_irq_mask(sgpio, bank, offset); sirfsoc_gpio_free()
639 sirfsoc_gpio_set_input(sgpio, SIRFSOC_GPIO_CTRL(bank->id, offset)); sirfsoc_gpio_free()
648 struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(chip); sirfsoc_gpio_direction_input() local
649 struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, gpio); sirfsoc_gpio_direction_input()
658 sirfsoc_gpio_set_input(sgpio, offset); sirfsoc_gpio_direction_input()
665 static inline void sirfsoc_gpio_set_output(struct sirfsoc_gpio_chip *sgpio, sirfsoc_gpio_set_output() argument
675 out_ctrl = readl(sgpio->chip.regs + offset); sirfsoc_gpio_set_output()
683 writel(out_ctrl, sgpio->chip.regs + offset); sirfsoc_gpio_set_output()
691 struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(chip); sirfsoc_gpio_direction_output() local
692 struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, gpio); sirfsoc_gpio_direction_output()
699 spin_lock_irqsave(&sgpio->lock, flags); sirfsoc_gpio_direction_output()
701 sirfsoc_gpio_set_output(sgpio, bank, offset, value); sirfsoc_gpio_direction_output()
703 spin_unlock_irqrestore(&sgpio->lock, flags); sirfsoc_gpio_direction_output()
710 struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(chip); sirfsoc_gpio_get_value() local
711 struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, offset); sirfsoc_gpio_get_value()
717 val = readl(sgpio->chip.regs + SIRFSOC_GPIO_CTRL(bank->id, offset)); sirfsoc_gpio_get_value()
727 struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(chip); sirfsoc_gpio_set_value() local
728 struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, offset); sirfsoc_gpio_set_value()
734 ctrl = readl(sgpio->chip.regs + SIRFSOC_GPIO_CTRL(bank->id, offset)); sirfsoc_gpio_set_value()
739 writel(ctrl, sgpio->chip.regs + SIRFSOC_GPIO_CTRL(bank->id, offset)); sirfsoc_gpio_set_value()
744 static void sirfsoc_gpio_set_pullup(struct sirfsoc_gpio_chip *sgpio, sirfsoc_gpio_set_pullup() argument
753 u32 val = readl(sgpio->chip.regs + offset); sirfsoc_gpio_set_pullup()
756 writel(val, sgpio->chip.regs + offset); sirfsoc_gpio_set_pullup()
761 static void sirfsoc_gpio_set_pulldown(struct sirfsoc_gpio_chip *sgpio, sirfsoc_gpio_set_pulldown() argument
770 u32 val = readl(sgpio->chip.regs + offset); sirfsoc_gpio_set_pulldown()
773 writel(val, sgpio->chip.regs + offset); sirfsoc_gpio_set_pulldown()
781 static struct sirfsoc_gpio_chip *sgpio; sirfsoc_gpio_probe() local
792 sgpio = devm_kzalloc(&pdev->dev, sizeof(*sgpio), GFP_KERNEL); sirfsoc_gpio_probe()
793 if (!sgpio) sirfsoc_gpio_probe()
795 spin_lock_init(&sgpio->lock); sirfsoc_gpio_probe()
801 sgpio->chip.gc.request = sirfsoc_gpio_request; sirfsoc_gpio_probe()
802 sgpio->chip.gc.free = sirfsoc_gpio_free; sirfsoc_gpio_probe()
803 sgpio->chip.gc.direction_input = sirfsoc_gpio_direction_input; sirfsoc_gpio_probe()
804 sgpio->chip.gc.get = sirfsoc_gpio_get_value; sirfsoc_gpio_probe()
805 sgpio->chip.gc.direction_output = sirfsoc_gpio_direction_output; sirfsoc_gpio_probe()
806 sgpio->chip.gc.set = sirfsoc_gpio_set_value; sirfsoc_gpio_probe()
807 sgpio->chip.gc.base = 0; sirfsoc_gpio_probe()
808 sgpio->chip.gc.ngpio = SIRFSOC_GPIO_BANK_SIZE * SIRFSOC_GPIO_NO_OF_BANKS; sirfsoc_gpio_probe()
809 sgpio->chip.gc.label = kstrdup(np->full_name, GFP_KERNEL); sirfsoc_gpio_probe()
810 sgpio->chip.gc.of_node = np; sirfsoc_gpio_probe()
811 sgpio->chip.gc.of_xlate = sirfsoc_gpio_of_xlate; sirfsoc_gpio_probe()
812 sgpio->chip.gc.of_gpio_n_cells = 2; sirfsoc_gpio_probe()
813 sgpio->chip.gc.dev = &pdev->dev; sirfsoc_gpio_probe()
814 sgpio->chip.regs = regs; sirfsoc_gpio_probe()
816 err = gpiochip_add(&sgpio->chip.gc); sirfsoc_gpio_probe()
823 err = gpiochip_irqchip_add(&sgpio->chip.gc, sirfsoc_gpio_probe()
834 bank = &sgpio->sgpio_bank[i]; sirfsoc_gpio_probe()
842 gpiochip_set_chained_irqchip(&sgpio->chip.gc, sirfsoc_gpio_probe()
848 err = gpiochip_add_pin_range(&sgpio->chip.gc, dev_name(&pdev->dev), sirfsoc_gpio_probe()
858 sirfsoc_gpio_set_pullup(sgpio, pullups); sirfsoc_gpio_probe()
862 sirfsoc_gpio_set_pulldown(sgpio, pulldowns); sirfsoc_gpio_probe()
868 gpiochip_remove(&sgpio->chip.gc); sirfsoc_gpio_probe()
/linux-4.1.27/drivers/scsi/isci/
H A Dhost.c1247 writel(SGPIO_HW_CONTROL, &ihost->scu_registers->peg0.sgpio.output_data_select[i]); isci_host_deinit()
1264 /* disable sgpio: where the above wait should give time for the isci_host_deinit()
1267 writel(0, &ihost->scu_registers->peg0.sgpio.interface_control); isci_host_deinit()
2372 /* enable sgpio */ isci_host_init()
2373 writel(1, &ihost->scu_registers->peg0.sgpio.interface_control); isci_host_init()
2375 writel(SGPIO_HW_CONTROL, &ihost->scu_registers->peg0.sgpio.output_data_select[i]); isci_host_init()
2376 writel(0, &ihost->scu_registers->peg0.sgpio.vendor_specific_code); isci_host_init()
2783 writel(val, &ihost->scu_registers->peg0.sgpio.output_data_select[d]); sci_write_gpio_tx_gp()
H A Dhost.h443 return ARRAY_SIZE(ihost->scu_registers->peg0.sgpio.output_data_select); isci_gpio_count()
H A Dregisters.h1822 struct scu_sgpio_registers sgpio; member in struct:scu_peg_registers
/linux-4.1.27/drivers/ata/
H A Dsata_highbank.c199 err = of_get_named_gpio(np, "calxeda,sgpio-gpio", i); highbank_set_em_messages()
H A Dlibahci.c378 em_ctl & EM_CTL_SGPIO ? "sgpio " : ""); ahci_show_em_supported()

Completed in 182 milliseconds