Lines Matching refs:spp_gchip
39 static inline u32 sppctl_first_readl(struct sppctl_gpio_chip *spp_gchip, u32 off) in sppctl_first_readl() argument
41 return readl(spp_gchip->first_base + SPPCTL_GPIO_OFF_FIRST + off); in sppctl_first_readl()
44 static inline void sppctl_first_writel(struct sppctl_gpio_chip *spp_gchip, u32 val, u32 off) in sppctl_first_writel() argument
46 writel(val, spp_gchip->first_base + SPPCTL_GPIO_OFF_FIRST + off); in sppctl_first_writel()
49 static inline u32 sppctl_gpio_master_readl(struct sppctl_gpio_chip *spp_gchip, u32 off) in sppctl_gpio_master_readl() argument
51 return readl(spp_gchip->gpioxt_base + SPPCTL_GPIO_OFF_MASTER + off); in sppctl_gpio_master_readl()
54 static inline void sppctl_gpio_master_writel(struct sppctl_gpio_chip *spp_gchip, u32 val, in sppctl_gpio_master_writel() argument
57 writel(val, spp_gchip->gpioxt_base + SPPCTL_GPIO_OFF_MASTER + off); in sppctl_gpio_master_writel()
60 static inline u32 sppctl_gpio_oe_readl(struct sppctl_gpio_chip *spp_gchip, u32 off) in sppctl_gpio_oe_readl() argument
62 return readl(spp_gchip->gpioxt_base + SPPCTL_GPIO_OFF_OE + off); in sppctl_gpio_oe_readl()
65 static inline void sppctl_gpio_oe_writel(struct sppctl_gpio_chip *spp_gchip, u32 val, u32 off) in sppctl_gpio_oe_writel() argument
67 writel(val, spp_gchip->gpioxt_base + SPPCTL_GPIO_OFF_OE + off); in sppctl_gpio_oe_writel()
70 static inline void sppctl_gpio_out_writel(struct sppctl_gpio_chip *spp_gchip, u32 val, u32 off) in sppctl_gpio_out_writel() argument
72 writel(val, spp_gchip->gpioxt_base + SPPCTL_GPIO_OFF_OUT + off); in sppctl_gpio_out_writel()
75 static inline u32 sppctl_gpio_in_readl(struct sppctl_gpio_chip *spp_gchip, u32 off) in sppctl_gpio_in_readl() argument
77 return readl(spp_gchip->gpioxt_base + SPPCTL_GPIO_OFF_IN + off); in sppctl_gpio_in_readl()
80 static inline u32 sppctl_gpio_iinv_readl(struct sppctl_gpio_chip *spp_gchip, u32 off) in sppctl_gpio_iinv_readl() argument
82 return readl(spp_gchip->gpioxt_base + SPPCTL_GPIO_OFF_IINV + off); in sppctl_gpio_iinv_readl()
85 static inline void sppctl_gpio_iinv_writel(struct sppctl_gpio_chip *spp_gchip, u32 val, in sppctl_gpio_iinv_writel() argument
88 writel(val, spp_gchip->gpioxt_base + SPPCTL_GPIO_OFF_IINV + off); in sppctl_gpio_iinv_writel()
91 static inline u32 sppctl_gpio_oinv_readl(struct sppctl_gpio_chip *spp_gchip, u32 off) in sppctl_gpio_oinv_readl() argument
93 return readl(spp_gchip->gpioxt_base + SPPCTL_GPIO_OFF_OINV + off); in sppctl_gpio_oinv_readl()
96 static inline void sppctl_gpio_oinv_writel(struct sppctl_gpio_chip *spp_gchip, u32 val, in sppctl_gpio_oinv_writel() argument
99 writel(val, spp_gchip->gpioxt_base + SPPCTL_GPIO_OFF_OINV + off); in sppctl_gpio_oinv_writel()
102 static inline u32 sppctl_gpio_od_readl(struct sppctl_gpio_chip *spp_gchip, u32 off) in sppctl_gpio_od_readl() argument
104 return readl(spp_gchip->gpioxt_base + SPPCTL_GPIO_OFF_OD + off); in sppctl_gpio_od_readl()
107 static inline void sppctl_gpio_od_writel(struct sppctl_gpio_chip *spp_gchip, u32 val, u32 off) in sppctl_gpio_od_writel() argument
109 writel(val, spp_gchip->gpioxt_base + SPPCTL_GPIO_OFF_OD + off); in sppctl_gpio_od_writel()
263 struct sppctl_gpio_chip *spp_gchip = gpiochip_get_data(chip); in sppctl_first_get() local
267 reg = sppctl_first_readl(spp_gchip, reg_off); in sppctl_first_get()
298 struct sppctl_gpio_chip *spp_gchip = gpiochip_get_data(chip); in sppctl_master_get() local
302 reg = sppctl_gpio_master_readl(spp_gchip, reg_off); in sppctl_master_get()
309 struct sppctl_gpio_chip *spp_gchip = gpiochip_get_data(chip); in sppctl_first_master_set() local
316 reg = sppctl_first_readl(spp_gchip, reg_off); in sppctl_first_master_set()
323 sppctl_first_writel(spp_gchip, reg, reg_off); in sppctl_first_master_set()
328 sppctl_first_writel(spp_gchip, reg, reg_off); in sppctl_first_master_set()
339 sppctl_gpio_master_writel(spp_gchip, reg, reg_off); in sppctl_first_master_set()
345 struct sppctl_gpio_chip *spp_gchip = gpiochip_get_data(chip); in sppctl_gpio_input_inv_set() local
349 sppctl_gpio_iinv_writel(spp_gchip, reg, reg_off); in sppctl_gpio_input_inv_set()
354 struct sppctl_gpio_chip *spp_gchip = gpiochip_get_data(chip); in sppctl_gpio_output_inv_set() local
358 sppctl_gpio_oinv_writel(spp_gchip, reg, reg_off); in sppctl_gpio_output_inv_set()
363 struct sppctl_gpio_chip *spp_gchip = gpiochip_get_data(chip); in sppctl_gpio_output_od_get() local
367 reg = sppctl_gpio_od_readl(spp_gchip, reg_off); in sppctl_gpio_output_od_get()
375 struct sppctl_gpio_chip *spp_gchip = gpiochip_get_data(chip); in sppctl_gpio_output_od_set() local
379 sppctl_gpio_od_writel(spp_gchip, reg, reg_off); in sppctl_gpio_output_od_set()
384 struct sppctl_gpio_chip *spp_gchip = gpiochip_get_data(chip); in sppctl_gpio_get_direction() local
388 reg = sppctl_gpio_oe_readl(spp_gchip, reg_off); in sppctl_gpio_get_direction()
395 struct sppctl_gpio_chip *spp_gchip = gpiochip_get_data(chip); in sppctl_gpio_inv_get() local
401 spin_lock_irqsave(&spp_gchip->lock, flags); in sppctl_gpio_inv_get()
404 reg = sppctl_gpio_iinv_readl(spp_gchip, reg_off); in sppctl_gpio_inv_get()
406 reg = sppctl_gpio_oinv_readl(spp_gchip, reg_off); in sppctl_gpio_inv_get()
408 spin_unlock_irqrestore(&spp_gchip->lock, flags); in sppctl_gpio_inv_get()
415 struct sppctl_gpio_chip *spp_gchip = gpiochip_get_data(chip); in sppctl_gpio_direction_input() local
421 spin_lock_irqsave(&spp_gchip->lock, flags); in sppctl_gpio_direction_input()
423 sppctl_gpio_oe_writel(spp_gchip, reg, reg_off); in sppctl_gpio_direction_input()
425 spin_unlock_irqrestore(&spp_gchip->lock, flags); in sppctl_gpio_direction_input()
431 struct sppctl_gpio_chip *spp_gchip = gpiochip_get_data(chip); in sppctl_gpio_direction_output() local
437 spin_lock_irqsave(&spp_gchip->lock, flags); in sppctl_gpio_direction_output()
439 sppctl_gpio_oe_writel(spp_gchip, reg, reg_off); in sppctl_gpio_direction_output()
442 spin_unlock_irqrestore(&spp_gchip->lock, flags); in sppctl_gpio_direction_output()
447 sppctl_gpio_out_writel(spp_gchip, reg, reg_off); in sppctl_gpio_direction_output()
449 spin_unlock_irqrestore(&spp_gchip->lock, flags); in sppctl_gpio_direction_output()
455 struct sppctl_gpio_chip *spp_gchip = gpiochip_get_data(chip); in sppctl_gpio_get() local
459 reg = sppctl_gpio_in_readl(spp_gchip, reg_off); in sppctl_gpio_get()
466 struct sppctl_gpio_chip *spp_gchip = gpiochip_get_data(chip); in sppctl_gpio_set() local
470 sppctl_gpio_out_writel(spp_gchip, reg, reg_off); in sppctl_gpio_set()
477 struct sppctl_gpio_chip *spp_gchip = gpiochip_get_data(chip); in sppctl_gpio_set_config() local
483 sppctl_gpio_od_writel(spp_gchip, reg, reg_off); in sppctl_gpio_set_config()
528 struct sppctl_gpio_chip *spp_gchip; in sppctl_gpio_new() local
532 spp_gchip = devm_kzalloc(&pdev->dev, sizeof(*spp_gchip), GFP_KERNEL); in sppctl_gpio_new()
533 if (!spp_gchip) in sppctl_gpio_new()
535 pctl->spp_gchip = spp_gchip; in sppctl_gpio_new()
537 spp_gchip->gpioxt_base = pctl->gpioxt_base; in sppctl_gpio_new()
538 spp_gchip->first_base = pctl->first_base; in sppctl_gpio_new()
539 spin_lock_init(&spp_gchip->lock); in sppctl_gpio_new()
541 gchip = &spp_gchip->chip; in sppctl_gpio_new()
565 err = devm_gpiochip_add_data(&pdev->dev, gchip, spp_gchip); in sppctl_gpio_new()
581 if (!sppctl_gpio_output_od_get(&pctl->spp_gchip->chip, pin)) in sppctl_pin_config_get()
587 if (!sppctl_first_get(&pctl->spp_gchip->chip, pin)) in sppctl_pin_config_get()
589 if (!sppctl_master_get(&pctl->spp_gchip->chip, pin)) in sppctl_pin_config_get()
591 if (sppctl_gpio_get_direction(&pctl->spp_gchip->chip, pin)) in sppctl_pin_config_get()
593 arg = sppctl_gpio_get(&pctl->spp_gchip->chip, pin); in sppctl_pin_config_get()
612 sppctl_first_master_set(&pctl->spp_gchip->chip, pin, mux_f_gpio, mux_m_iop); in sppctl_pin_config_set()
618 sppctl_gpio_direction_output(&pctl->spp_gchip->chip, pin, 0); in sppctl_pin_config_set()
620 sppctl_gpio_direction_output(&pctl->spp_gchip->chip, pin, 1); in sppctl_pin_config_set()
622 sppctl_gpio_input_inv_set(&pctl->spp_gchip->chip, pin); in sppctl_pin_config_set()
624 sppctl_gpio_output_inv_set(&pctl->spp_gchip->chip, pin); in sppctl_pin_config_set()
626 sppctl_gpio_output_od_set(&pctl->spp_gchip->chip, pin, 1); in sppctl_pin_config_set()
713 sppctl_first_master_set(&pctl->spp_gchip->chip, group_selector, in sppctl_set_mux()
720 sppctl_first_master_set(&pctl->spp_gchip->chip, in sppctl_set_mux()
741 g_f = sppctl_first_get(&pctl->spp_gchip->chip, offset); in sppctl_gpio_request_enable()
742 g_m = sppctl_master_get(&pctl->spp_gchip->chip, offset); in sppctl_gpio_request_enable()
746 sppctl_first_master_set(&pctl->spp_gchip->chip, offset, mux_f_gpio, mux_m_gpio); in sppctl_gpio_request_enable()
811 first = sppctl_first_get(&pctl->spp_gchip->chip, offset); in sppctl_pin_dbg_show()
812 master = sppctl_master_get(&pctl->spp_gchip->chip, offset); in sppctl_pin_dbg_show()