diff options
| author | Loïc Guégan <loic.guegan@mailbox.org> | 2025-09-30 13:04:00 +0200 |
|---|---|---|
| committer | Loïc Guégan <loic.guegan@mailbox.org> | 2025-09-30 13:04:00 +0200 |
| commit | f22a0dadcbed6655d94a88c754513b747d9e0118 (patch) | |
| tree | f57a95d1e134ea7fb79095af083efa2c9e5c11fa | |
| parent | d993980f4713ec05807f55ca88c1f0608a290417 (diff) | |
Update i2c_driver api6.12.48+deb13-amd64
| -rwxr-xr-x | ina260.c | 34 |
1 files changed, 17 insertions, 17 deletions
@@ -34,7 +34,7 @@ static int ina260_avgs[8]={ // ina260 operating modes list static char ina260_modes[8][42]={ "Power-Down (or Shutdown)","Shunt Current, Triggered", - "Bus Voltage, Triggered","Shunt Current and Bus Voltage, Triggered", + "Bus Voltage, Triggered","Shunt Current and Bus Voltage, Triggered", "Power-Down (or Shutdown)","Shunt Current, Continuous","Bus Voltage, Continuous", "Shunt Current and Bus Voltage, Continuous" }; @@ -62,7 +62,7 @@ MODULE_DEVICE_TABLE(i2c,ina260_ids); /** * @brief Read from ina260 registers - * + * * @param cdata client data to use to communicate * @param reg register to read * @param value register content output @@ -86,7 +86,7 @@ static int ina260_read_register(struct client_data* cdata, unsigned char reg, in /** * @brief Write to ina260 registers - * + * * @param cdata client data to use to communicate * @param reg register to write to * @param value value to write in @a reg @@ -102,7 +102,7 @@ static int ina260_write_register(struct client_data* cdata, unsigned char reg, i return 0; } -static ssize_t attr_show(struct kobject *_kobj, +static ssize_t attr_show(struct kobject *_kobj, struct kobj_attribute *attr, char *buf) { @@ -133,16 +133,16 @@ static ssize_t attr_show(struct kobject *_kobj, return sprintf(buf, "%x\n", rvalue); } - - -static ssize_t attr_store(struct kobject *_kobj, + + +static ssize_t attr_store(struct kobject *_kobj, struct kobj_attribute *attr, const char *buf, size_t count) { int uvalue; struct client_data *cdata=container_of(_kobj,struct client_data,kobj); unsigned char reg=INA260_REG_CONFIGURATION; - + if(kstrtoint(buf, 0,&uvalue)) return -EINVAL; @@ -187,7 +187,7 @@ static ssize_t attr_metric_show(struct kobject *_kobj, return -1; } -static ssize_t attr_field_show(struct kobject *_kobj, +static ssize_t attr_field_show(struct kobject *_kobj, struct kobj_attribute *attr, char *buf) { @@ -299,7 +299,7 @@ static int ina260_write_field1(struct client_data *cdata, unsigned char reg, uns return 0; } -static ssize_t attr_field_store(struct kobject *_kobj, +static ssize_t attr_field_store(struct kobject *_kobj, struct kobj_attribute *attr, const char __user *buf, size_t count) { @@ -370,7 +370,7 @@ static struct attribute *registers_attrs[] = { &alert_limit_attribute.attr, &manufacturer_id_attribute.attr, &die_id_attribute.attr, - NULL, + NULL, }; static const struct attribute_group registers_group = { .attrs = registers_attrs, @@ -391,7 +391,7 @@ static struct attribute *metrics_attrs[] = { &metric_power_attribute.attr, &metric_voltage_attribute.attr, &metric_current_attribute.attr, - NULL, + NULL, }; static const struct attribute_group metrics_group = { .attrs = metrics_attrs @@ -432,7 +432,7 @@ static struct kobj_attribute len_field_attribute = static struct kobj_attribute did_field_attribute = __ATTR(did, 0444, attr_field_show, attr_field_store); static struct kobj_attribute rid_field_attribute = - __ATTR(rid, 0444, attr_field_show, attr_field_store); + __ATTR(rid, 0444, attr_field_show, attr_field_store); static struct attribute *fields_attrs[] = { &reset_field_attribute.attr, &avg_field_attribute.attr, @@ -452,7 +452,7 @@ static struct attribute *fields_attrs[] = { &len_field_attribute.attr, &did_field_attribute.attr, &rid_field_attribute.attr, - NULL, + NULL, }; static const struct attribute_group fields_group = { .attrs = fields_attrs, @@ -466,7 +466,7 @@ static struct kobj_type ina260_ktype = { /** * @brief Compare on ina260 register to a supplied value - * + * * @param client i2c client to use for communications * @param reg register to use for comparison * @param value register expected value @@ -481,7 +481,7 @@ static int ina260_probe_register(struct i2c_client *client, unsigned char reg, i return ((bytes[0]<<8) | bytes[1])!=value; } -static int ina260_probe_new(struct i2c_client *client){ +static int ina260_probe(struct i2c_client *client){ struct client_data *p; // Attempt device discovery: if(ina260_probe_register(client,INA260_REG_MANUFACTURER,0x5449) || @@ -524,7 +524,7 @@ static struct i2c_driver ina260_driver = { .driver = { .name = "ina260" }, - .probe_new = ina260_probe_new, + .probe = ina260_probe, .remove = ina260_remove, .id_table = ina260_ids }; |
