mirror of
https://gitlab.com/manzerbredes/ina260-sysfs-driver.git
synced 2025-04-19 04:09:45 +00:00
Minor changes
This commit is contained in:
parent
0b4b81e273
commit
07e3c2c7fe
1 changed files with 36 additions and 9 deletions
45
ina260.c
45
ina260.c
|
@ -271,6 +271,33 @@ static ssize_t attr_field_store(struct kobject *_kobj,
|
|||
} else if(INA260_IS_ATTR(ishct)){
|
||||
if(ina260_set_register_3bits(cdata,reg,3,data))
|
||||
return -EINVAL;
|
||||
} else if(INA260_IS_ATTR(vbusct)){
|
||||
if(ina260_set_register_3bits(cdata,reg,6,data))
|
||||
return -EINVAL;
|
||||
} else if(INA260_IS_ATTR(ocl)){
|
||||
if(ina260_set_register_1bit(cdata,reg,15,data))
|
||||
return -EINVAL;
|
||||
} else if(INA260_IS_ATTR(ucl)){
|
||||
if(ina260_set_register_1bit(cdata,reg,14,data))
|
||||
return -EINVAL;
|
||||
} else if(INA260_IS_ATTR(bol)){
|
||||
if(ina260_set_register_1bit(cdata,reg,13,data))
|
||||
return -EINVAL;
|
||||
} else if(INA260_IS_ATTR(bul)){
|
||||
if(ina260_set_register_1bit(cdata,reg,12,data))
|
||||
return -EINVAL;
|
||||
} else if(INA260_IS_ATTR(pol)){
|
||||
if(ina260_set_register_1bit(cdata,reg,11,data))
|
||||
return -EINVAL;
|
||||
} else if(INA260_IS_ATTR(cnvr)){
|
||||
if(ina260_set_register_1bit(cdata,reg,10,data))
|
||||
return -EINVAL;
|
||||
} else if(INA260_IS_ATTR(apol)){
|
||||
if(ina260_set_register_1bit(cdata,reg,1,data))
|
||||
return -EINVAL;
|
||||
} else if(INA260_IS_ATTR(len)){
|
||||
if(ina260_set_register_1bit(cdata,reg,0,data))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return count;
|
||||
|
@ -324,29 +351,29 @@ static struct kobj_attribute mode_field_attribute =
|
|||
static struct kobj_attribute ishct_field_attribute =
|
||||
__ATTR(ishct, 0664, attr_field_show, attr_field_store);
|
||||
static struct kobj_attribute vbusct_field_attribute =
|
||||
__ATTR(vbusct, 0444, attr_field_show, attr_field_store);
|
||||
__ATTR(vbusct, 0664, attr_field_show, attr_field_store);
|
||||
static struct kobj_attribute aff_field_attribute =
|
||||
__ATTR(aff, 0444, attr_field_show, attr_field_store);
|
||||
static struct kobj_attribute cvrf_field_attribute =
|
||||
__ATTR(cvrf, 0444, attr_field_show, attr_field_store);
|
||||
static struct kobj_attribute ocl_field_attribute =
|
||||
__ATTR(ocl, 0444, attr_field_show, attr_field_store);
|
||||
__ATTR(ocl, 0664, attr_field_show, attr_field_store);
|
||||
static struct kobj_attribute ucl_field_attribute =
|
||||
__ATTR(ucl, 0444, attr_field_show, attr_field_store);
|
||||
__ATTR(ucl, 0664, attr_field_show, attr_field_store);
|
||||
static struct kobj_attribute bol_field_attribute =
|
||||
__ATTR(bol, 0444, attr_field_show, attr_field_store);
|
||||
__ATTR(bol, 0664, attr_field_show, attr_field_store);
|
||||
static struct kobj_attribute bul_field_attribute =
|
||||
__ATTR(bul, 0444, attr_field_show, attr_field_store);
|
||||
__ATTR(bul, 0664, attr_field_show, attr_field_store);
|
||||
static struct kobj_attribute pol_field_attribute =
|
||||
__ATTR(pol, 0444, attr_field_show, attr_field_store);
|
||||
__ATTR(pol, 0664, attr_field_show, attr_field_store);
|
||||
static struct kobj_attribute cnvr_field_attribute =
|
||||
__ATTR(cnvr, 0444, attr_field_show, attr_field_store);
|
||||
__ATTR(cnvr, 0664, attr_field_show, attr_field_store);
|
||||
static struct kobj_attribute ovf_field_attribute =
|
||||
__ATTR(ovf, 0444, attr_field_show, attr_field_store);
|
||||
static struct kobj_attribute apol_field_attribute =
|
||||
__ATTR(apol, 0444, attr_field_show, attr_field_store);
|
||||
__ATTR(apol, 0664, attr_field_show, attr_field_store);
|
||||
static struct kobj_attribute len_field_attribute =
|
||||
__ATTR(len, 0444, attr_field_show, attr_field_store);
|
||||
__ATTR(len, 0664, attr_field_show, attr_field_store);
|
||||
static struct kobj_attribute did_field_attribute =
|
||||
__ATTR(did, 0444, attr_field_show, attr_field_store);
|
||||
static struct kobj_attribute rid_field_attribute =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue