Lines Matching refs:pmap

59 	struct dc_pinmap *pmap = pinctrl_dev_get_drvdata(pctldev);  in dc_get_group_name()  local
62 return pmap->desc->pins[selector].name; in dc_get_group_name()
69 struct dc_pinmap *pmap = pinctrl_dev_get_drvdata(pctldev); in dc_get_group_pins() local
71 *pins = &pmap->desc->pins[selector].number; in dc_get_group_pins()
106 struct dc_pinmap *pmap = pinctrl_dev_get_drvdata(pctldev); in dc_get_groups() local
108 *groups = pmap->pin_names; in dc_get_groups()
128 struct dc_pinmap *pmap = pinctrl_dev_get_drvdata(pctldev); in dc_set_mux() local
134 reg = readb_relaxed(pmap->regs + reg_off); in dc_set_mux()
137 writeb_relaxed(reg, pmap->regs + reg_off); in dc_set_mux()
146 struct dc_pinmap *pmap = pinctrl_dev_get_drvdata(pcdev); in dc_pmx_request_gpio() local
152 reg = readb_relaxed(pmap->regs + reg_off); in dc_pmx_request_gpio()
169 struct dc_pinmap *pmap = gpiochip_get_data(chip); in dc_gpio_direction_input() local
175 spin_lock_irqsave(&pmap->lock, flags); in dc_gpio_direction_input()
176 drive = readb_relaxed(pmap->regs + reg_off); in dc_gpio_direction_input()
178 writeb_relaxed(drive, pmap->regs + reg_off); in dc_gpio_direction_input()
179 spin_unlock_irqrestore(&pmap->lock, flags); in dc_gpio_direction_input()
189 struct dc_pinmap *pmap = gpiochip_get_data(chip); in dc_gpio_direction_output() local
197 spin_lock_irqsave(&pmap->lock, flags); in dc_gpio_direction_output()
198 drive = readb_relaxed(pmap->regs + reg_off); in dc_gpio_direction_output()
200 writeb_relaxed(drive, pmap->regs + reg_off); in dc_gpio_direction_output()
201 spin_unlock_irqrestore(&pmap->lock, flags); in dc_gpio_direction_output()
208 struct dc_pinmap *pmap = gpiochip_get_data(chip); in dc_gpio_get() local
213 input = readb_relaxed(pmap->regs + reg_off); in dc_gpio_get()
220 struct dc_pinmap *pmap = gpiochip_get_data(chip); in dc_gpio_set() local
226 spin_lock_irqsave(&pmap->lock, flags); in dc_gpio_set()
227 output = readb_relaxed(pmap->regs + reg_off); in dc_gpio_set()
232 writeb_relaxed(output, pmap->regs + reg_off); in dc_gpio_set()
233 spin_unlock_irqrestore(&pmap->lock, flags); in dc_gpio_set()
236 static int dc_gpiochip_add(struct dc_pinmap *pmap, struct device_node *np) in dc_gpiochip_add() argument
238 struct gpio_chip *chip = &pmap->chip; in dc_gpiochip_add()
242 chip->parent = pmap->dev; in dc_gpiochip_add()
254 spin_lock_init(&pmap->lock); in dc_gpiochip_add()
256 ret = gpiochip_add_data(chip, pmap); in dc_gpiochip_add()
260 ret = gpiochip_add_pin_range(chip, dev_name(pmap->dev), 0, 0, in dc_gpiochip_add()
272 struct dc_pinmap *pmap; in dc_pinctrl_probe() local
279 pmap = devm_kzalloc(&pdev->dev, sizeof(*pmap), GFP_KERNEL); in dc_pinctrl_probe()
280 if (!pmap) in dc_pinctrl_probe()
283 pmap->regs = devm_platform_ioremap_resource(pdev, 0); in dc_pinctrl_probe()
284 if (IS_ERR(pmap->regs)) in dc_pinctrl_probe()
285 return PTR_ERR(pmap->regs); in dc_pinctrl_probe()
305 pmap->pin_names[pin_id] = name; in dc_pinctrl_probe()
319 pmap->desc = pctl_desc; in dc_pinctrl_probe()
321 pmap->dev = &pdev->dev; in dc_pinctrl_probe()
323 pmap->pctl = devm_pinctrl_register(&pdev->dev, pctl_desc, pmap); in dc_pinctrl_probe()
324 if (IS_ERR(pmap->pctl)) { in dc_pinctrl_probe()
326 return PTR_ERR(pmap->pctl); in dc_pinctrl_probe()
329 return dc_gpiochip_add(pmap, pdev->dev.of_node); in dc_pinctrl_probe()