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 v2 03/11] pmic: Add support for setting transmission length in uclass private data
Date: Mon, 14 May 2018 08:01:28 +1000	[thread overview]
Message-ID: <CAPnjgZ3V93FdbLhXqPtqw2MPQspRYeCwu--QwWH6ONwfOMmP7A@mail.gmail.com> (raw)
In-Reply-To: <20180506202608.5899-4-lukma@denx.de>

On 7 May 2018 at 06:26, Lukasz Majewski <lukma@denx.de> wrote:
> The struct dm_pmic_info's trans_len field stores the number of types to
> be transmitted per PMIC transfer.
>
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
>
> ---
>
> Changes in v2:
> - New patch
>
>  drivers/power/pmic/pmic-uclass.c | 10 ++++++++++
>  include/power/pmic.h             |  4 ++++
>  2 files changed, 14 insertions(+)
>

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

Please see below.

> diff --git a/drivers/power/pmic/pmic-uclass.c b/drivers/power/pmic/pmic-uclass.c
> index 5e8f6d6190..88669533bd 100644
> --- a/drivers/power/pmic/pmic-uclass.c
> +++ b/drivers/power/pmic/pmic-uclass.c
> @@ -166,7 +166,17 @@ int pmic_clrsetbits(struct udevice *dev, uint reg, uint clr, uint set)
>         return pmic_reg_write(dev, reg, byte);
>  }
>
> +static int pmic_pre_probe(struct udevice *dev)
> +{
> +       struct dm_pmic_info *pmic_info = dev_get_uclass_priv(dev);
> +
> +       pmic_info->trans_len = 1;
> +       return 0;
> +}
> +
>  UCLASS_DRIVER(pmic) = {
>         .id             = UCLASS_PMIC,
>         .name           = "pmic",
> +       .pre_probe      = pmic_pre_probe,
> +       .per_device_auto_alloc_size = sizeof(struct dm_pmic_info),
>  };
> diff --git a/include/power/pmic.h b/include/power/pmic.h
> index f2fe537fb7..0791c6aa2c 100644
> --- a/include/power/pmic.h
> +++ b/include/power/pmic.h
> @@ -298,6 +298,10 @@ int pmic_reg_write(struct udevice *dev, uint reg, uint value);
>   */
>  int pmic_clrsetbits(struct udevice *dev, uint reg, uint clr, uint set);
>
> +struct dm_pmic_info {
> +       uint trans_len;

Please add a comment for this. Also, how about uc_pmic_priv since this
is device-specific private information owned by the uclass.

> +};
> +
>  #endif /* CONFIG_DM_PMIC */
>
>  #ifdef CONFIG_POWER
> --
> 2.11.0
>

  reply	other threads:[~2018-05-13 22:01 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-06 20:25 [U-Boot] [PATCH v2 00/11] pmic: sandbox: Add support for MC34709 PMIC Lukasz Majewski
2018-05-06 20:25 ` [U-Boot] [PATCH v2 01/11] pmic: fsl: Provide some more definitions for MC34708 PMIC Lukasz Majewski
2018-05-06 20:25 ` [U-Boot] [PATCH v2 02/11] pmic: fsl: Define number of bytes sent at once by " Lukasz Majewski
2018-05-13 22:01   ` Simon Glass
2018-05-06 20:26 ` [U-Boot] [PATCH v2 03/11] pmic: Add support for setting transmission length in uclass private data Lukasz Majewski
2018-05-13 22:01   ` Simon Glass [this message]
2018-05-06 20:26 ` [U-Boot] [PATCH v2 04/11] pmic: dm: Rewrite pmic_reg_{read|write|clrsetbits} to support 3 bytes transmissions Lukasz Majewski
2018-05-13 22:01   ` Simon Glass
2018-05-14  9:47     ` Lukasz Majewski
2018-05-06 20:26 ` [U-Boot] [PATCH v2 05/11] pmic: dm: Add support for MC34708 for PMIC DM Lukasz Majewski
2018-05-13 22:01   ` Simon Glass
2018-05-14 10:01     ` Lukasz Majewski
2018-05-06 20:26 ` [U-Boot] [PATCH v2 06/11] pmic: Rewrite the pmic command to not only work with single byte transmission Lukasz Majewski
2018-05-13 22:01   ` Simon Glass
2018-05-06 20:26 ` [U-Boot] [PATCH v2 07/11] sandbox: Rewrite i2c_pmic_emul.c to support PMIC with 3 bytes transmission Lukasz Majewski
2018-05-13 22:02   ` Simon Glass
2018-05-14 10:46     ` Lukasz Majewski
2018-05-06 20:26 ` [U-Boot] [PATCH v2 08/11] sandbox: Enable support for MC34708 PMIC in DTS Lukasz Majewski
2018-05-06 20:35   ` Fabio Estevam
2018-05-07 14:12     ` Lukasz Majewski
2018-05-13 22:02   ` Simon Glass
2018-05-06 20:26 ` [U-Boot] [PATCH v2 09/11] sandbox: Enable MC34708 PMIC support Lukasz Majewski
2018-05-13 22:02   ` Simon Glass
2018-05-06 20:26 ` [U-Boot] [PATCH v2 10/11] sandbox: tests: Exclude common test code (pmic_get) in test/dm/pmic.c Lukasz Majewski
2018-05-13 22:02   ` Simon Glass
2018-05-06 20:26 ` [U-Boot] [PATCH v2 11/11] sandbox: tests: Add tests for mc34708 PMIC device Lukasz Majewski
2018-05-13 22:02   ` 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=CAPnjgZ3V93FdbLhXqPtqw2MPQspRYeCwu--QwWH6ONwfOMmP7A@mail.gmail.com \
    --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.