Skip to contentSkip to conversation

iio:adc:ad799x driver broken after commit "Write default config on probe and reset alert status on probe"

DISCUSSION Lars-Peter Clausen 2 participants 3 messages Nov 25, 2014 – Nov 26, 2014 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 5 lines · Mike Looijmans

After this commit:

iio:adc:ad799x: Write default config on probe and reset alert status on
probe

Quoted 7 lines

writing ALERT_EN and BUSY_ALERT to the chip config register clears pending alerts, BUSY_ALERT is cleared when reading back the register

The AD7999 on our board no longer functions, reading the in_voltage*_raw sysfiles always returns "255" after this.

I reverted the commit, and that fixed the problem for me.

I suspect that there is something going wrong when reading back the config register, can you check the attached patch and see what the output is?

Thanks,
- Lars

drivers/iio/adc/ad799x.c +2 -0
index e37412d..babbdde 100644
@@ -816,6 +816,8 @@ static int ad799x_probe(struct i2c_client *client,
 	if (ret < 0)
 		goto error_disable_reg;
 	st->config = ret;
+	dev_info(&client->dev, "config: %x %x\n", st->config,
+		st->chip_config->default_config);
 
 	ret = iio_triggered_buffer_setup(indio_dev, NULL,
 		&ad799x_trigger_handler, NULL);
#2 lore raw
Quoted 12 lines · Lars-Peter Clausen
Quoted 11 lines · Mike Looijmans

After this commit:

iio:adc:ad799x: Write default config on probe and reset alert status on
probe

writing ALERT_EN and BUSY_ALERT to the chip config register clears pending alerts, BUSY_ALERT is cleared when reading back the register

The AD7999 on our board no longer functions, reading the in_voltage*_raw sysfiles always returns "255" after this.

Quoted 8 lines
Quoted 1 line

I reverted the commit, and that fixed the problem for me.

I suspect that there is something going wrong when reading back the config register, can you check the attached patch and see what the output is?

Thanks,
- Lars

The attached patch delivered the following output (using the current head code):

ad799x 1-0029: config: b 0

Met vriendelijke groet / kind regards,

Mike Looijmans
System Expert

TOPIC Embedded Systems Eindhovenseweg 32-C, NL-5683 KH Best Postbus 440, NL-5680 AK Best
Telefoon: (+31) (0) 499 33 69 79
Telefax: (+31) (0) 499 33 69 70
E-mail: [email protected]
Website: www.topic.nl

Please consider the environment before printing this e-mail

Topic zoekt gedreven (embedded) software specialisten!
http://topic.nl/vacatures/topic-zoekt-software-engineers/

#3 lore raw
Quoted 18 lines · Mike Looijmans
Quoted 17 lines · Lars-Peter Clausen
Quoted 5 lines · Mike Looijmans

After this commit:

iio:adc:ad799x: Write default config on probe and reset alert status on
probe

Quoted 7 lines

writing ALERT_EN and BUSY_ALERT to the chip config register clears pending alerts, BUSY_ALERT is cleared when reading back the register

The AD7999 on our board no longer functions, reading the in_voltage*_raw sysfiles always returns "255" after this.

I reverted the commit, and that fixed the problem for me.

I suspect that there is something going wrong when reading back the config register, can you check the attached patch and see what the output is?

Quoted 9 lines
Quoted 3 lines

Thanks,
- Lars

The attached patch delivered the following output (using the current head code):

ad799x 1-0029: config: b 0

Yea, kind of what I expected based on your description. Looking at the datasheet it seems the ad7999 doesn't even support register read back which would explain the issue. I'll try to find a board and see if I can fix it.

- Lars