Lines Matching refs:spics
65 struct spear_spics *spics = gpiochip_get_data(chip); in spics_set_value() local
69 tmp = readl_relaxed(spics->base + spics->perip_cfg); in spics_set_value()
70 if (spics->last_off != offset) { in spics_set_value()
71 spics->last_off = offset; in spics_set_value()
72 tmp &= ~(spics->cs_enable_mask << spics->cs_enable_shift); in spics_set_value()
73 tmp |= offset << spics->cs_enable_shift; in spics_set_value()
77 tmp &= ~(0x1 << spics->cs_value_bit); in spics_set_value()
78 tmp |= value << spics->cs_value_bit; in spics_set_value()
79 writel_relaxed(tmp, spics->base + spics->perip_cfg); in spics_set_value()
96 struct spear_spics *spics = gpiochip_get_data(chip); in spics_request() local
99 if (!spics->use_count++) { in spics_request()
100 tmp = readl_relaxed(spics->base + spics->perip_cfg); in spics_request()
101 tmp |= 0x1 << spics->sw_enable_bit; in spics_request()
102 tmp |= 0x1 << spics->cs_value_bit; in spics_request()
103 writel_relaxed(tmp, spics->base + spics->perip_cfg); in spics_request()
111 struct spear_spics *spics = gpiochip_get_data(chip); in spics_free() local
114 if (!--spics->use_count) { in spics_free()
115 tmp = readl_relaxed(spics->base + spics->perip_cfg); in spics_free()
116 tmp &= ~(0x1 << spics->sw_enable_bit); in spics_free()
117 writel_relaxed(tmp, spics->base + spics->perip_cfg); in spics_free()
124 struct spear_spics *spics; in spics_gpio_probe() local
127 spics = devm_kzalloc(&pdev->dev, sizeof(*spics), GFP_KERNEL); in spics_gpio_probe()
128 if (!spics) in spics_gpio_probe()
131 spics->base = devm_platform_ioremap_resource(pdev, 0); in spics_gpio_probe()
132 if (IS_ERR(spics->base)) in spics_gpio_probe()
133 return PTR_ERR(spics->base); in spics_gpio_probe()
136 &spics->perip_cfg)) in spics_gpio_probe()
139 &spics->sw_enable_bit)) in spics_gpio_probe()
142 &spics->cs_value_bit)) in spics_gpio_probe()
145 &spics->cs_enable_mask)) in spics_gpio_probe()
148 &spics->cs_enable_shift)) in spics_gpio_probe()
151 platform_set_drvdata(pdev, spics); in spics_gpio_probe()
153 spics->chip.ngpio = NUM_OF_GPIO; in spics_gpio_probe()
154 spics->chip.base = -1; in spics_gpio_probe()
155 spics->chip.request = spics_request; in spics_gpio_probe()
156 spics->chip.free = spics_free; in spics_gpio_probe()
157 spics->chip.direction_input = spics_direction_input; in spics_gpio_probe()
158 spics->chip.direction_output = spics_direction_output; in spics_gpio_probe()
159 spics->chip.get = spics_get_value; in spics_gpio_probe()
160 spics->chip.set = spics_set_value; in spics_gpio_probe()
161 spics->chip.label = dev_name(&pdev->dev); in spics_gpio_probe()
162 spics->chip.parent = &pdev->dev; in spics_gpio_probe()
163 spics->chip.owner = THIS_MODULE; in spics_gpio_probe()
164 spics->last_off = -1; in spics_gpio_probe()
166 ret = devm_gpiochip_add_data(&pdev->dev, &spics->chip, spics); in spics_gpio_probe()