Lines Matching refs:spics

62 	struct spear_spics *spics = gpiochip_get_data(chip);  in spics_set_value()  local
66 tmp = readl_relaxed(spics->base + spics->perip_cfg); in spics_set_value()
67 if (spics->last_off != offset) { in spics_set_value()
68 spics->last_off = offset; in spics_set_value()
69 tmp &= ~(spics->cs_enable_mask << spics->cs_enable_shift); in spics_set_value()
70 tmp |= offset << spics->cs_enable_shift; in spics_set_value()
74 tmp &= ~(0x1 << spics->cs_value_bit); in spics_set_value()
75 tmp |= value << spics->cs_value_bit; in spics_set_value()
76 writel_relaxed(tmp, spics->base + spics->perip_cfg); in spics_set_value()
93 struct spear_spics *spics = gpiochip_get_data(chip); in spics_request() local
96 if (!spics->use_count++) { in spics_request()
97 tmp = readl_relaxed(spics->base + spics->perip_cfg); in spics_request()
98 tmp |= 0x1 << spics->sw_enable_bit; in spics_request()
99 tmp |= 0x1 << spics->cs_value_bit; in spics_request()
100 writel_relaxed(tmp, spics->base + spics->perip_cfg); in spics_request()
108 struct spear_spics *spics = gpiochip_get_data(chip); in spics_free() local
111 if (!--spics->use_count) { in spics_free()
112 tmp = readl_relaxed(spics->base + spics->perip_cfg); in spics_free()
113 tmp &= ~(0x1 << spics->sw_enable_bit); in spics_free()
114 writel_relaxed(tmp, spics->base + spics->perip_cfg); in spics_free()
121 struct spear_spics *spics; in spics_gpio_probe() local
123 spics = devm_kzalloc(&pdev->dev, sizeof(*spics), GFP_KERNEL); in spics_gpio_probe()
124 if (!spics) in spics_gpio_probe()
127 spics->base = devm_platform_ioremap_resource(pdev, 0); in spics_gpio_probe()
128 if (IS_ERR(spics->base)) in spics_gpio_probe()
129 return PTR_ERR(spics->base); in spics_gpio_probe()
132 &spics->perip_cfg)) in spics_gpio_probe()
135 &spics->sw_enable_bit)) in spics_gpio_probe()
138 &spics->cs_value_bit)) in spics_gpio_probe()
141 &spics->cs_enable_mask)) in spics_gpio_probe()
144 &spics->cs_enable_shift)) in spics_gpio_probe()
147 spics->chip.ngpio = NUM_OF_GPIO; in spics_gpio_probe()
148 spics->chip.base = -1; in spics_gpio_probe()
149 spics->chip.request = spics_request; in spics_gpio_probe()
150 spics->chip.free = spics_free; in spics_gpio_probe()
151 spics->chip.direction_input = spics_direction_input; in spics_gpio_probe()
152 spics->chip.direction_output = spics_direction_output; in spics_gpio_probe()
153 spics->chip.get = spics_get_value; in spics_gpio_probe()
154 spics->chip.set = spics_set_value; in spics_gpio_probe()
155 spics->chip.label = dev_name(&pdev->dev); in spics_gpio_probe()
156 spics->chip.parent = &pdev->dev; in spics_gpio_probe()
157 spics->chip.owner = THIS_MODULE; in spics_gpio_probe()
158 spics->last_off = -1; in spics_gpio_probe()
160 return devm_gpiochip_add_data(&pdev->dev, &spics->chip, spics); in spics_gpio_probe()