Lines Matching +full:high +full:- +full:side
1 // SPDX-License-Identifier: GPL-2.0-only
3 * MC33880 high-side/low-side switch GPIO driver
8 * Freescale MC33880 high-side/low-side switch
45 return spi_write(mc->spi, &mc->port_config, sizeof(mc->port_config)); in mc33880_write_config()
52 mc->port_config |= 1 << offset; in __mc33880_set()
54 mc->port_config &= ~(1 << offset); in __mc33880_set()
64 mutex_lock(&mc->lock); in mc33880_set()
68 mutex_unlock(&mc->lock); in mc33880_set()
77 pdata = dev_get_platdata(&spi->dev); in mc33880_probe()
78 if (!pdata || !pdata->base) { in mc33880_probe()
79 dev_dbg(&spi->dev, "incorrect or missing platform data\n"); in mc33880_probe()
80 return -EINVAL; in mc33880_probe()
86 spi->bits_per_word = 8; in mc33880_probe()
92 mc = devm_kzalloc(&spi->dev, sizeof(struct mc33880), GFP_KERNEL); in mc33880_probe()
94 return -ENOMEM; in mc33880_probe()
96 mutex_init(&mc->lock); in mc33880_probe()
100 mc->spi = spi; in mc33880_probe()
102 mc->chip.label = DRIVER_NAME, in mc33880_probe()
103 mc->chip.set = mc33880_set; in mc33880_probe()
104 mc->chip.base = pdata->base; in mc33880_probe()
105 mc->chip.ngpio = PIN_NUMBER; in mc33880_probe()
106 mc->chip.can_sleep = true; in mc33880_probe()
107 mc->chip.parent = &spi->dev; in mc33880_probe()
108 mc->chip.owner = THIS_MODULE; in mc33880_probe()
110 mc->port_config = 0x00; in mc33880_probe()
116 mc->port_config = 0x00; in mc33880_probe()
121 dev_err(&spi->dev, "Failed writing to " DRIVER_NAME ": %d\n", in mc33880_probe()
126 ret = gpiochip_add_data(&mc->chip, mc); in mc33880_probe()
133 mutex_destroy(&mc->lock); in mc33880_probe()
143 gpiochip_remove(&mc->chip); in mc33880_remove()
144 mutex_destroy(&mc->lock); in mc33880_remove()
170 MODULE_AUTHOR("Mocean Laboratories <info@mocean-labs.com>");