Searched refs:hcg (Results 1 – 2 of 2) sorted by relevance
/openbmc/linux/drivers/gpio/ |
H A D | gpio-creg-snps.c | 32 struct creg_gpio *hcg = gpiochip_get_data(gc); in creg_gpio_set() local 33 const struct creg_layout *layout = hcg->layout; in creg_gpio_set() 38 value = val ? hcg->layout->on[offset] : hcg->layout->off[offset]; in creg_gpio_set() 44 spin_lock_irqsave(&hcg->lock, flags); in creg_gpio_set() 45 reg = readl(hcg->regs); in creg_gpio_set() 48 writel(reg, hcg->regs); in creg_gpio_set() 49 spin_unlock_irqrestore(&hcg->lock, flags); in creg_gpio_set() 59 static int creg_gpio_validate_pg(struct device *dev, struct creg_gpio *hcg, in creg_gpio_validate_pg() argument 62 const struct creg_layout *layout = hcg->layout; in creg_gpio_validate_pg() 81 static int creg_gpio_validate(struct device *dev, struct creg_gpio *hcg, in creg_gpio_validate() argument [all …]
|
/openbmc/u-boot/drivers/gpio/ |
H A D | hsdk-creg-gpio.c | 31 struct hsdk_creg_gpio *hcg = dev_get_priv(dev); in hsdk_creg_gpio_set_value() local 32 u8 reg_shift = oft * hcg->bit_per_gpio + hcg->shift; in hsdk_creg_gpio_set_value() 33 u32 reg = readl(hcg->regs); in hsdk_creg_gpio_set_value() 35 reg &= ~(GENMASK(hcg->bit_per_gpio - 1, 0) << reg_shift); in hsdk_creg_gpio_set_value() 36 reg |= ((val ? hcg->deactivate : hcg->activate) << reg_shift); in hsdk_creg_gpio_set_value() 38 writel(reg, hcg->regs); in hsdk_creg_gpio_set_value() 62 struct hsdk_creg_gpio *hcg = dev_get_priv(dev); in hsdk_creg_gpio_get_value() local 63 u32 val = readl(hcg->regs); in hsdk_creg_gpio_get_value() 65 val >>= oft * hcg->bit_per_gpio + hcg->shift; in hsdk_creg_gpio_get_value() 66 val &= GENMASK(hcg->bit_per_gpio - 1, 0); in hsdk_creg_gpio_get_value() [all …]
|