public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 1/6] dm: i2c: Add u8 read/write i2c functions
Date: Tue, 20 Sep 2016 07:07:22 +0200	[thread overview]
Message-ID: <57E0C40A.2090307@denx.de> (raw)
In-Reply-To: <1474265858-25753-2-git-send-email-j-keerthy@ti.com>

Hello,

Am 19.09.2016 um 08:17 schrieb Keerthy:
> Add u8 i2c read/write hooks.
>
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
>   drivers/i2c/i2c-uclass.c | 10 ++++++++++
>   include/i2c.h            | 24 ++++++++++++++++++++++++
>   2 files changed, 34 insertions(+)

Reviewed-by: Heiko Schocher <hs@denx.de>

bye,
Heiko
>
> diff --git a/drivers/i2c/i2c-uclass.c b/drivers/i2c/i2c-uclass.c
> index dbd3789..6ce5d9a 100644
> --- a/drivers/i2c/i2c-uclass.c
> +++ b/drivers/i2c/i2c-uclass.c
> @@ -231,6 +231,16 @@ int dm_i2c_reg_write(struct udevice *dev, uint offset, uint value)
>   	return dm_i2c_write(dev, offset, &val, 1);
>   }
>
> +int dm_i2c_u8_read(struct udevice *dev, uint offset, u8 *val)
> +{
> +	return dm_i2c_read(dev, offset, val, 1);
> +}
> +
> +int dm_i2c_u8_write(struct udevice *dev, uint offset, u8 *val)
> +{
> +	return dm_i2c_write(dev, offset, val, 1);
> +}
> +
>   /**
>    * i2c_probe_chip() - probe for a chip on a bus
>    *
> diff --git a/include/i2c.h b/include/i2c.h
> index d500445..c3059ad 100644
> --- a/include/i2c.h
> +++ b/include/i2c.h
> @@ -191,6 +191,30 @@ int dm_i2c_reg_read(struct udevice *dev, uint offset);
>   int dm_i2c_reg_write(struct udevice *dev, uint offset, unsigned int val);
>
>   /**
> + * dm_i2c_u8_read() - Read a byte value from an I2C register
> + *
> + * This reads a single value from the given address in an I2C chip
> + *
> + * @dev:        Device to use for transfer
> + * @addr:       Address to read from
> + * @val:	Value read is stored in val
> + * @return 0 for success, -ve on error
> + */
> +int dm_i2c_u8_read(struct udevice *dev, uint offset, u8 *val);
> +
> +/**
> + * dm_i2c_u8_write() - Write a byte value to an I2C register
> + *
> + * This writes a single value to the given address in an I2C chip
> + *
> + * @dev:        Device to use for transfer
> + * @addr:       Address to write to
> + * @val:        Value to write
> + * @return 0 on success, -ve on error
> + */
> +int dm_i2c_u8_write(struct udevice *dev, uint offset, u8 *val);
> +
> +/**
>    * dm_i2c_xfer() - Transfer messages over I2C
>    *
>    * This transfers a raw message. It is best to use dm_i2c_reg_read/write()
>

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  parent reply	other threads:[~2016-09-20  5:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-19  6:17 [U-Boot] [PATCH v3 0/6] power: pmic: Add support for Palmas family of PMICs Keerthy
2016-09-19  6:17 ` [U-Boot] [PATCH v3 1/6] dm: i2c: Add u8 read/write i2c functions Keerthy
2016-09-20  2:06   ` Tom Rini
2016-09-20  5:07   ` Heiko Schocher [this message]
2016-09-20 11:53   ` Simon Glass
2016-09-20 12:42     ` Keerthy
2016-09-23  4:17       ` Simon Glass
2016-09-19  6:17 ` [U-Boot] [PATCH v3 2/6] power: regulator: Add ctrl_reg and volt_reg fields for pmic Keerthy
2016-09-20  2:06   ` Tom Rini
2016-09-23  4:15   ` Simon Glass
2016-09-25 12:06     ` Keerthy
2016-09-19  6:17 ` [U-Boot] [PATCH v3 3/6] power: pmic: Palmas: Add the base pmic support Keerthy
2016-09-20  2:06   ` Tom Rini
2016-09-23  4:15   ` Simon Glass
2016-09-25 12:05     ` Keerthy
2016-09-19  6:17 ` [U-Boot] [PATCH v3 4/6] power: regulator: palmas: Add regulator support Keerthy
2016-09-20  2:06   ` Tom Rini
2016-09-19  6:17 ` [U-Boot] [PATCH v3 5/6] configs: am57xx_evm_defconfig: Enable PALMAS options Keerthy
2016-09-20  2:06   ` Tom Rini
2016-09-19  6:17 ` [U-Boot] [PATCH v3 6/6] configs: dra7xx_evm_defconfig: " Keerthy
2016-09-20  2:06   ` Tom Rini

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=57E0C40A.2090307@denx.de \
    --to=hs@denx.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox