• Home
  • Raw
  • Download

Lines Matching +full:dout +full:- +full:gpios

11  * 28 GPIOs. 8 of them can trigger an interrupt. See datasheet for more
14 * - DIN must be stable at the rising edge of clock.
15 * - when writing:
16 * - always clock in 16 clocks at once
17 * - at DIN: D15 first, D0 last
18 * - D0..D7 = databyte, D8..D14 = commandbyte
19 * - D15 = low -> write command
20 * - when reading
21 * - always clock in 16 clocks at once
22 * - at DIN: D15 first, D0 last
23 * - D0..D7 = dummy, D8..D14 = register address
24 * - D15 = high -> read command
25 * - raise CS and assert it again
26 * - always clock in 16 clocks at once
27 * - at DOUT: D15 first, D0 last
28 * - D0..D7 contains the data from the first cycle
62 config = &ts->port_config[offset >> 2]; in max7301_direction_input()
64 if (ts->input_pullup_active & BIT(offset)) in max7301_direction_input()
69 mutex_lock(&ts->lock); in max7301_direction_input()
74 ret = ts->write(ts->dev, 0x08 + (offset >> 2), *config); in max7301_direction_input()
76 mutex_unlock(&ts->lock); in max7301_direction_input()
84 ts->out_level |= 1 << offset; in __max7301_set()
85 return ts->write(ts->dev, 0x20 + offset, 0x01); in __max7301_set()
87 ts->out_level &= ~(1 << offset); in __max7301_set()
88 return ts->write(ts->dev, 0x20 + offset, 0x00); in __max7301_set()
104 config = &ts->port_config[offset >> 2]; in max7301_direction_output()
106 mutex_lock(&ts->lock); in max7301_direction_output()
114 ret = ts->write(ts->dev, 0x08 + (offset >> 2), *config); in max7301_direction_output()
116 mutex_unlock(&ts->lock); in max7301_direction_output()
124 int config, level = -EINVAL; in max7301_get()
129 mutex_lock(&ts->lock); in max7301_get()
131 config = (ts->port_config[offset >> 2] >> ((offset & 3) << 1)) in max7301_get()
137 level = !!(ts->out_level & (1 << offset)); in max7301_get()
142 level = ts->read(ts->dev, 0x20 + offset) & 0x01; in max7301_get()
144 mutex_unlock(&ts->lock); in max7301_get()
156 mutex_lock(&ts->lock); in max7301_set()
160 mutex_unlock(&ts->lock); in max7301_set()
165 struct device *dev = ts->dev; in __max730x_probe()
171 mutex_init(&ts->lock); in __max730x_probe()
175 ts->write(dev, 0x04, 0x01); in __max730x_probe()
178 ts->input_pullup_active = pdata->input_pullup_active; in __max730x_probe()
179 ts->chip.base = pdata->base; in __max730x_probe()
181 ts->chip.base = -1; in __max730x_probe()
183 ts->chip.label = dev->driver->name; in __max730x_probe()
185 ts->chip.direction_input = max7301_direction_input; in __max730x_probe()
186 ts->chip.get = max7301_get; in __max730x_probe()
187 ts->chip.direction_output = max7301_direction_output; in __max730x_probe()
188 ts->chip.set = max7301_set; in __max730x_probe()
190 ts->chip.ngpio = PIN_NUMBER; in __max730x_probe()
191 ts->chip.can_sleep = true; in __max730x_probe()
192 ts->chip.parent = dev; in __max730x_probe()
193 ts->chip.owner = THIS_MODULE; in __max730x_probe()
195 ret = gpiochip_add_data(&ts->chip, ts); in __max730x_probe()
211 ts->port_config[i] = 0xAA; in __max730x_probe()
213 int offset = (i - 1) * 4 + j; in __max730x_probe()
214 ret = max7301_direction_input(&ts->chip, offset); in __max730x_probe()
223 mutex_destroy(&ts->lock); in __max730x_probe()
233 return -ENODEV; in __max730x_remove()
236 ts->write(dev, 0x04, 0x00); in __max730x_remove()
237 gpiochip_remove(&ts->chip); in __max730x_remove()
238 mutex_destroy(&ts->lock); in __max730x_remove()
245 MODULE_DESCRIPTION("MAX730x GPIO-Expanders, generic parts");