Lines Matching refs:hcg
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()
67 return (val == hcg->deactivate) ? 1 : 0; in hsdk_creg_gpio_get_value()
80 struct hsdk_creg_gpio *hcg = dev_get_priv(dev); in hsdk_creg_gpio_probe() local
84 hcg->regs = (u32 *)devfdt_get_addr_ptr(dev); in hsdk_creg_gpio_probe()
138 hcg->shift = (u8)shift; in hsdk_creg_gpio_probe()
139 hcg->bit_per_gpio = (u8)bit_per_gpio; in hsdk_creg_gpio_probe()
140 hcg->activate = (u8)activate; in hsdk_creg_gpio_probe()
141 hcg->deactivate = (u8)deactivate; in hsdk_creg_gpio_probe()
150 uc_priv->bank_name, hcg->regs, uc_priv->gpio_count); in hsdk_creg_gpio_probe()