Searched refs:spics (Results 1 - 1 of 1) sorted by relevance
/linux-4.1.27/drivers/gpio/ |
H A D | gpio-spear-spics.c | 65 struct spear_spics *spics = container_of(chip, struct spear_spics, spics_set_value() local 70 tmp = readl_relaxed(spics->base + spics->perip_cfg); spics_set_value() 71 if (spics->last_off != offset) { spics_set_value() 72 spics->last_off = offset; spics_set_value() 73 tmp &= ~(spics->cs_enable_mask << spics->cs_enable_shift); spics_set_value() 74 tmp |= offset << spics->cs_enable_shift; spics_set_value() 78 tmp &= ~(0x1 << spics->cs_value_bit); spics_set_value() 79 tmp |= value << spics->cs_value_bit; spics_set_value() 80 writel_relaxed(tmp, spics->base + spics->perip_cfg); spics_set_value() 97 struct spear_spics *spics = container_of(chip, struct spear_spics, spics_request() local 101 if (!spics->use_count++) { spics_request() 102 tmp = readl_relaxed(spics->base + spics->perip_cfg); spics_request() 103 tmp |= 0x1 << spics->sw_enable_bit; spics_request() 104 tmp |= 0x1 << spics->cs_value_bit; spics_request() 105 writel_relaxed(tmp, spics->base + spics->perip_cfg); spics_request() 113 struct spear_spics *spics = container_of(chip, struct spear_spics, spics_free() local 117 if (!--spics->use_count) { spics_free() 118 tmp = readl_relaxed(spics->base + spics->perip_cfg); spics_free() 119 tmp &= ~(0x1 << spics->sw_enable_bit); spics_free() 120 writel_relaxed(tmp, spics->base + spics->perip_cfg); spics_free() 127 struct spear_spics *spics; spics_gpio_probe() local 131 spics = devm_kzalloc(&pdev->dev, sizeof(*spics), GFP_KERNEL); spics_gpio_probe() 132 if (!spics) spics_gpio_probe() 136 spics->base = devm_ioremap_resource(&pdev->dev, res); spics_gpio_probe() 137 if (IS_ERR(spics->base)) spics_gpio_probe() 138 return PTR_ERR(spics->base); spics_gpio_probe() 140 if (of_property_read_u32(np, "st-spics,peripcfg-reg", spics_gpio_probe() 141 &spics->perip_cfg)) spics_gpio_probe() 143 if (of_property_read_u32(np, "st-spics,sw-enable-bit", spics_gpio_probe() 144 &spics->sw_enable_bit)) spics_gpio_probe() 146 if (of_property_read_u32(np, "st-spics,cs-value-bit", spics_gpio_probe() 147 &spics->cs_value_bit)) spics_gpio_probe() 149 if (of_property_read_u32(np, "st-spics,cs-enable-mask", spics_gpio_probe() 150 &spics->cs_enable_mask)) spics_gpio_probe() 152 if (of_property_read_u32(np, "st-spics,cs-enable-shift", spics_gpio_probe() 153 &spics->cs_enable_shift)) spics_gpio_probe() 156 platform_set_drvdata(pdev, spics); spics_gpio_probe() 158 spics->chip.ngpio = NUM_OF_GPIO; spics_gpio_probe() 159 spics->chip.base = -1; spics_gpio_probe() 160 spics->chip.request = spics_request; spics_gpio_probe() 161 spics->chip.free = spics_free; spics_gpio_probe() 162 spics->chip.direction_input = spics_direction_input; spics_gpio_probe() 163 spics->chip.direction_output = spics_direction_output; spics_gpio_probe() 164 spics->chip.get = spics_get_value; spics_gpio_probe() 165 spics->chip.set = spics_set_value; spics_gpio_probe() 166 spics->chip.label = dev_name(&pdev->dev); spics_gpio_probe() 167 spics->chip.dev = &pdev->dev; spics_gpio_probe() 168 spics->chip.owner = THIS_MODULE; spics_gpio_probe() 169 spics->last_off = -1; spics_gpio_probe() 171 ret = gpiochip_add(&spics->chip); spics_gpio_probe() 177 dev_info(&pdev->dev, "spear spics registered\n"); spics_gpio_probe() 186 { .compatible = "st,spear-spics-gpio" }, 194 .name = "spear-spics-gpio",
|
Completed in 100 milliseconds