Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: amplifiers: ad8366: consume enable gpio

Some parts may consume enable GPIO to enable serial mode
(HMC1119's and HMC792A P/S pin) or powerup the device
(e.g. ADA4961's PWUP pin).

Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Rodrigo Alencar and committed by
Jonathan Cameron
d99a03d6 d5e02d0d

+6
+6
drivers/iio/amplifiers/ad8366.c
··· 217 217 static int ad8366_probe(struct spi_device *spi) 218 218 { 219 219 struct device *dev = &spi->dev; 220 + struct gpio_desc *enable_gpio; 220 221 struct reset_control *rstc; 221 222 struct iio_dev *indio_dev; 222 223 struct ad8366_state *st; ··· 239 238 240 239 st->spi = spi; 241 240 st->info = spi_get_device_match_data(spi); 241 + 242 + enable_gpio = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_HIGH); 243 + if (IS_ERR(enable_gpio)) 244 + return dev_err_probe(dev, PTR_ERR(enable_gpio), 245 + "Failed to get enable GPIO\n"); 242 246 243 247 rstc = devm_reset_control_get_optional_exclusive_deasserted(dev, NULL); 244 248 if (IS_ERR(rstc))