Skip to content

iio: adc: ad4130: Fix clock init and GPIO init. #2842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions drivers/iio/adc/ad4130.c
Original file line number Diff line number Diff line change
Expand Up @@ -1863,7 +1863,7 @@ static int ad4130_setup_int_clk(struct ad4130_state *st)
{
struct device *dev = &st->spi->dev;
struct device_node *of_node = dev_of_node(dev);
struct clk_init_data init;
struct clk_init_data init = {};
const char *clk_name;
struct clk *clk;
int ret;
Expand Down Expand Up @@ -1940,7 +1940,12 @@ static int ad4130_setup(struct iio_dev *indio_dev)
* Configure all GPIOs for output. If configured, the interrupt function
* of P2 takes priority over the GPIO out function.
*/
val = AD4130_IO_CONTROL_GPIO_CTRL_MASK;
val = 0;
for (i = 0; i < AD4130_MAX_GPIOS; i++) {
if (st->pins_fn[i + AD4130_AIN2_P1] != AD4130_PIN_FN_NONE)
continue;
val |= FIELD_PREP(AD4130_IO_CONTROL_GPIO_CTRL_MASK, BIT(i));
}
val |= FIELD_PREP(AD4130_IO_CONTROL_INT_PIN_SEL_MASK, st->int_pin_sel);

ret = regmap_write(st->regmap, AD4130_IO_CONTROL_REG, val);
Expand Down