Lines Matching +full:single +full:- +full:wire
1 // SPDX-License-Identifier: GPL-2.0
3 * BQ27xxx battery monitor HDQ/1-wire driver
5 * Copyright (C) 2007-2017 Texas Instruments Incorporated - https://www.ti.com/
26 MODULE_PARM_DESC(F_ID, "1-wire slave FID for BQ27xxx device");
32 mutex_lock(&sl->master->bus_mutex); in w1_bq27000_read()
33 w1_write_8(sl->master, HDQ_CMD_READ | reg); in w1_bq27000_read()
34 val = w1_read_8(sl->master); in w1_bq27000_read()
35 mutex_unlock(&sl->master->bus_mutex); in w1_bq27000_read()
41 bool single) in bq27xxx_battery_hdq_read() argument
43 struct w1_slave *sl = dev_to_w1_slave(di->dev); in bq27xxx_battery_hdq_read()
48 if (!single) { in bq27xxx_battery_hdq_read()
64 } while (temp != upper && --timeout); in bq27xxx_battery_hdq_read()
67 return -EIO; in bq27xxx_battery_hdq_read()
79 di = devm_kzalloc(&sl->dev, sizeof(*di), GFP_KERNEL); in bq27xxx_battery_hdq_add_slave()
81 return -ENOMEM; in bq27xxx_battery_hdq_add_slave()
83 dev_set_drvdata(&sl->dev, di); in bq27xxx_battery_hdq_add_slave()
85 di->dev = &sl->dev; in bq27xxx_battery_hdq_add_slave()
86 di->chip = BQ27000; in bq27xxx_battery_hdq_add_slave()
87 di->name = "bq27000-battery"; in bq27xxx_battery_hdq_add_slave()
88 di->bus.read = bq27xxx_battery_hdq_read; in bq27xxx_battery_hdq_add_slave()
95 struct bq27xxx_device_info *di = dev_get_drvdata(&sl->dev); in bq27xxx_battery_hdq_remove_slave()
126 MODULE_DESCRIPTION("BQ27xxx battery monitor HDQ/1-wire driver");
128 MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_BQ27000));