On 7/23/24 07:20, Guenter Roeck wrote:
On Tue, Jul 23, 2024 at 05:37:11AM +0000, Tzung-Bi Shih wrote:
On Mon, Jul 22, 2024 at 05:52:00PM -0700, Guenter Roeck wrote:
+static int max6697_config_of(struct max6697_data *data, struct i2c_client *client)
{
[...]
- pdata->smbus_timeout_disable =
- of_property_read_bool(node, "smbus-timeout-disable");
- pdata->extended_range_enable =
- of_property_read_bool(node, "extended-range-enable");
- pdata->beta_compensation =
- of_property_read_bool(node, "beta-compensation-enable");
+ confreg = 0;
+ if (of_property_read_bool(node, "smbus-timeout-disable") &&
+ (data->chip->valid_conf & MAX6697_CONF_TIMEOUT)) {
s/data->chip/chip/.
+ if (data->type == max6581) {
Should be `data->type != max6581`.
Correct, It needs a bit more, actually. For max6581, the check needs to be
if (of_property_read_u32(node, "resistance-cancellation", &vals[0]) &&
of_property_read_bool(node, "resistance-cancellation"))
vals[0] = 0xfe;
else
vals[0] = 0;
That isn't correct either.
if (of_property_read_u32(node, "resistance-cancellation", &vals[0])) {
if (of_property_read_bool(node, "resistance-cancellation"))
vals[0] = 0xfe;
else
vals[0] = 0;
}
should do it.
Guenter