-
Notifications
You must be signed in to change notification settings - Fork 844
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
Add support for LT8491 #2639
base: main
Are you sure you want to change the base?
Add support for LT8491 #2639
Conversation
54a629b
to
4c40e24
Compare
Add documentation for devicetree bindings for LT8491 Signed-off-by: John Erasmus Mari Geronimo <[email protected]>
4c40e24
to
b597332
Compare
LT8491 High Voltage Buck-Boost Battery Charge Controller with I2C Signed-off-by: John Erasmus Mari Geronimo <[email protected]>
Add entry for the LT8491 driver. Signed-off-by: John Erasmus Mari Geronimo <[email protected]>
f2a2abe
to
a1081a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it goes my first round
description: Resistance value of RFBIN2 in ohms. | ||
|
||
adi,rfbin1-ohms: | ||
description: Resistance value of RFBIN1 in ohms. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any constrains for the resistor values (or default values)?
- adi,rfbout2-ohms | ||
- adi,rdaci-ohms | ||
- adi,rfbin2-ohms | ||
- adi,rfbin1-ohms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure. Are all these properties really mandatory?
if (!info) | ||
return -ENOMEM; | ||
|
||
i2c_set_clientdata(client, info); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems you only have this because you pass the client in lt8491_configure_telemetry()? Why not just passing info
?
ret = lt8491_configure_resistor(client, "adi,rfbin1-ohms", 100, | ||
LT8491_CFG_RFBIN1_REG); | ||
if (ret < 0) | ||
return ret; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return lt8491_configure_resistor()
if (ret) | ||
return ret; | ||
|
||
return val; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
??
return serial_number[i]; | ||
} | ||
|
||
ret = sprintf(strval, "%04x%04x%04x", serial_number[0], serial_number[1], serial_number[2]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sysfs_emit()
|
||
static s32 lt8491_update_telemetry(struct lt8491_info *info) | ||
{ | ||
return i2c_smbus_write_byte_data(info->client, LT8491_CTRL_UPDATE_TELEM_REG, 0xAA); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think this helper to be much helpful...
|
||
return 0; | ||
case POWER_SUPPLY_PROP_MANUFACTURER: | ||
val->strval = "Linear Technology Corporation"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be Analog Devices now?
|
||
ret = i2c_smbus_read_word_data(info->client, LT8491_TELE_TBAT_REG); | ||
if (ret < 0) | ||
return ret; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if (at least) the above 4 cases won't need a lock? Another question that might make sense for the lock need is... why do we always need to call lt8491_update_telemetry()
?
|
||
return 0; | ||
case POWER_SUPPLY_PROP_SERIAL_NUMBER: | ||
ret = lt8491_read_serial_number(info, strval); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I missing something or strval
is just some garbage unallocated pointer?
PR Description
PR Type
PR Checklist