All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 07/25] power: Export register access functions from as3722
Date: Mon, 30 Mar 2015 18:04:20 -0600	[thread overview]
Message-ID: <1427760278-4573-8-git-send-email-sjg@chromium.org> (raw)
In-Reply-To: <1427760278-4573-1-git-send-email-sjg@chromium.org>

With the full PMIC framework we may be able to avoid this. But for now
we need access to the PMIC.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/power/as3722.c | 16 +++++++++++++---
 include/power/as3722.h |  3 +++
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/power/as3722.c b/drivers/power/as3722.c
index a60bb5f..c09e1de 100644
--- a/drivers/power/as3722.c
+++ b/drivers/power/as3722.c
@@ -27,7 +27,7 @@
 #define  AS3722_DEVICE_ID 0x0c
 #define AS3722_ASIC_ID2 0x91
 
-static int as3722_read(struct udevice *pmic, u8 reg, u8 *value)
+int as3722_read(struct udevice *pmic, u8 reg, u8 *value)
 {
 	int err;
 
@@ -38,7 +38,7 @@ static int as3722_read(struct udevice *pmic, u8 reg, u8 *value)
 	return 0;
 }
 
-static int as3722_write(struct udevice *pmic, u8 reg, u8 value)
+int as3722_write(struct udevice *pmic, u8 reg, u8 value)
 {
 	int err;
 
@@ -234,6 +234,15 @@ int as3722_gpio_direction_output(struct udevice *pmic, unsigned int gpio,
 	return 0;
 }
 
+/* Temporary function until we get the pmic framework */
+int as3722_get(struct udevice **devp)
+{
+	int bus = 0;
+	int address = 0x40;
+
+	return i2c_get_chip_for_busnum(bus, address, 1, devp);
+}
+
 int as3722_init(struct udevice **devp)
 {
 	struct udevice *pmic;
@@ -258,7 +267,8 @@ int as3722_init(struct udevice **devp)
 
 	debug("AS3722 revision %#x found on I2C bus %u, address %#x\n",
 	      revision, bus, address);
-	*devp = pmic;
+	if (devp)
+		*devp = pmic;
 
 	return 0;
 }
diff --git a/include/power/as3722.h b/include/power/as3722.h
index aa966d2..0f22482 100644
--- a/include/power/as3722.h
+++ b/include/power/as3722.h
@@ -23,5 +23,8 @@ int as3722_gpio_configure(struct udevice *pmic, unsigned int gpio,
 			  unsigned long flags);
 int as3722_gpio_direction_output(struct udevice *pmic, unsigned int gpio,
 				 unsigned int level);
+int as3722_read(struct udevice *pmic, u8 reg, u8 *value);
+int as3722_write(struct udevice *pmic, u8 reg, u8 value);
+int as3722_get(struct udevice **devp);
 
 #endif /* __POWER_AS3722_H__ */
-- 
2.2.0.rc0.207.ga3a616c

  parent reply	other threads:[~2015-03-31  0:04 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-31  0:04 [U-Boot] [PATCH v4 0/25] tegra: Add eDP support for nyan-big Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 01/25] dm: gpio: Add error handling and a function to claim vector GPIOs Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 02/25] fdt: Add binding decode function for display-timings Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 03/25] tegra: Move the pwm into tegra-common Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 04/25] tegra: pwm: Allow the clock rate to be left as is Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 05/25] tegra: Move checkboard() into the board code Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 06/25] tegra: Add a board ID function Simon Glass
2015-03-31  0:04 ` Simon Glass [this message]
2015-03-31  0:04 ` [U-Boot] [PATCH v4 08/25] tegra: Provide a function to allow LCD PMIC setup Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 09/25] tegra: Add support for setting up a as3722 PMIC Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 10/25] tegra: nyan-big: Add LCD PMIC init and board ID Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 11/25] tegra124: dts: Add host1x node to provide display information Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 12/25] tegra: config: Use CONFIG_LCD to detect LCD presence Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 13/25] tegra: clock: Add checking for invalid clock IDs Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 14/25] tegra: clock: Split the clock source code into a separate function Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 15/25] tegra124: clock: Add display clocks and functions Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 16/25] tegra: Move display controller header into common Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 17/25] video: Add drm_dp_helper.h Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 18/25] edid: Add a function to read detailed monitor timings Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 19/25] dm: video: Add a uclass for display port Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 20/25] tegra: dts: nyan-big: Add definitions for eDP display Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 21/25] tegra: video: Support serial output resource (SOR) on tegra124 Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 22/25] tegra: video: Add Embedded DisplayPort driver Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 23/25] tegra: video: support eDP displays on Tegra124 devices Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 24/25] tegra: config: nyan-big: Enable LCD Simon Glass
2015-03-31  0:04 ` [U-Boot] [PATCH v4 25/25] tegra124: video: Add full link training for eDP Simon Glass

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=1427760278-4573-8-git-send-email-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.