Lines Matching +full:com +full:- +full:offset
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2015-2023 Texas Instruments Incorporated - https://www.ti.com/
4 * Andrew Davis <afd@ti.com>
15 * struct tpic2810 - GPIO driver data
28 static void tpic2810_set(struct gpio_chip *chip, unsigned offset, int value);
31 unsigned offset) in tpic2810_get_direction() argument
38 unsigned offset) in tpic2810_direction_input() argument
41 return -EINVAL; in tpic2810_direction_input()
45 unsigned offset, int value) in tpic2810_direction_output() argument
48 tpic2810_set(chip, offset, value); in tpic2810_direction_output()
58 mutex_lock(&gpio->lock); in tpic2810_set_mask_bits()
60 buffer = gpio->buffer & ~mask; in tpic2810_set_mask_bits()
63 err = i2c_smbus_write_byte_data(gpio->client, TPIC2810_WS_COMMAND, in tpic2810_set_mask_bits()
66 gpio->buffer = buffer; in tpic2810_set_mask_bits()
68 mutex_unlock(&gpio->lock); in tpic2810_set_mask_bits()
71 static void tpic2810_set(struct gpio_chip *chip, unsigned offset, int value) in tpic2810_set() argument
73 tpic2810_set_mask_bits(chip, BIT(offset), value ? BIT(offset) : 0); in tpic2810_set()
90 .base = -1,
105 gpio = devm_kzalloc(&client->dev, sizeof(*gpio), GFP_KERNEL); in tpic2810_probe()
107 return -ENOMEM; in tpic2810_probe()
109 gpio->chip = template_chip; in tpic2810_probe()
110 gpio->chip.parent = &client->dev; in tpic2810_probe()
112 gpio->client = client; in tpic2810_probe()
114 mutex_init(&gpio->lock); in tpic2810_probe()
116 return devm_gpiochip_add_data(&client->dev, &gpio->chip, gpio); in tpic2810_probe()
135 MODULE_AUTHOR("Andrew Davis <afd@ti.com>");
136 MODULE_DESCRIPTION("TPIC2810 8-Bit LED Driver GPIO Driver");