linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Liam Breck <liam@networkimprov.net>
To: Sebastian Reichel <sre@kernel.org>
Cc: "Andrew F. Davis" <afd@ti.com>,
	linux-pm@vger.kernel.org,
	Matt Ranostay <matt@ranostay.consulting>,
	Liam Breck <kernel@networkimprov.net>
Subject: [PATCH v9 5/8] power: bq27xxx_battery: Define access methods to write chip registers
Date: Sun,  5 Mar 2017 23:25:36 -0800	[thread overview]
Message-ID: <20170306072539.980-6-liam@networkimprov.net> (raw)
In-Reply-To: <20170306072539.980-1-liam@networkimprov.net>

From: Matt Ranostay <matt@ranostay.consulting>

write(), read_bulk(), write_bulk() support setting chip registers,
e.g. with data obtained from power_supply_battery_info.

Signed-off-by: Matt Ranostay <matt@ranostay.consulting>
Signed-off-by: Liam Breck <kernel@networkimprov.net>
---
 include/linux/power/bq27xxx_battery.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/linux/power/bq27xxx_battery.h b/include/linux/power/bq27xxx_battery.h
index bed9557..92df553 100644
--- a/include/linux/power/bq27xxx_battery.h
+++ b/include/linux/power/bq27xxx_battery.h
@@ -32,6 +32,9 @@ struct bq27xxx_platform_data {
 struct bq27xxx_device_info;
 struct bq27xxx_access_methods {
 	int (*read)(struct bq27xxx_device_info *di, u8 reg, bool single);
+	int (*write)(struct bq27xxx_device_info *di, u8 reg, int value, bool single);
+	int (*read_bulk)(struct bq27xxx_device_info *di, u8 reg, u8 *data, int len);
+	int (*write_bulk)(struct bq27xxx_device_info *di, u8 reg, u8 *data, int len);
 };
 
 struct bq27xxx_reg_cache {
-- 
2.9.3

  parent reply	other threads:[~2017-03-06  7:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-06  7:25 [PATCH v9 0/8] devicetree battery support and client bq27xxx_battery Liam Breck
2017-03-06  7:25 ` [PATCH v9 2/8] devicetree: property-units: Add uWh and uAh units Liam Breck
     [not found] ` <20170306072539.980-1-liam-RYWXG+zxWwBdeoIcmNTgJF6hYfS7NtTn@public.gmane.org>
2017-03-06  7:25   ` [PATCH v9 1/8] devicetree: power: Add battery.txt Liam Breck
2017-03-06  7:25   ` [PATCH v9 3/8] devicetree: power: bq27xxx: Add monitored-battery documentation Liam Breck
2017-03-06  7:25 ` [PATCH v9 4/8] power: power_supply: Add power_supply_battery_info and API Liam Breck
2017-03-06  7:25 ` Liam Breck [this message]
2017-03-06  7:25 ` [PATCH v9 6/8] power: bq27xxx_battery: Move BQ27421 chip id to its own group Liam Breck
2017-03-06  7:25 ` [PATCH v9 7/8] power: bq27xxx_battery: Add power_supply_battery_info support Liam Breck
2017-03-06  7:25 ` [PATCH v9 8/8] power: bq27xxx_battery_i2c: Add I2C bulk read/write functions Liam Breck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170306072539.980-6-liam@networkimprov.net \
    --to=liam@networkimprov.net \
    --cc=afd@ti.com \
    --cc=kernel@networkimprov.net \
    --cc=linux-pm@vger.kernel.org \
    --cc=matt@ranostay.consulting \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).