All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ivan T. Ivanov" <iivanov@mm-sol.com>
To: Gilad Avidov <gavidov@codeaurora.org>
Cc: sdharia@codeaurora.org, mlocke@codeaurora.org,
	linux-arm-msm@vger.kernel.org, gregkh@linuxfoundation.org,
	linux-kernel@vger.kernel.org, galak@codeaurora.org,
	agross@codeaurora.org
Subject: Re: [PATCH V4 2/2] spmi: pmic_arb: add support for hw version 2
Date: Mon, 23 Feb 2015 11:59:14 +0200	[thread overview]
Message-ID: <1424685554.2340.2.camel@mm-sol.com> (raw)
In-Reply-To: <1424386453-18092-3-git-send-email-gavidov@codeaurora.org>

Hi Gilad,

On Thu, 2015-02-19 at 15:54 -0700, Gilad Avidov wrote:
> Qualcomm PMIC Arbiter version-2 changes from version-1 are:
> 
> - Some different register offsets.
> - New channel register space, one per PMIC peripheral (ppid).
>   All tx traffic uses these channels.
> - New observer register space. All rx trafic uses this space.
> - Different command format for spmi command registers.
> 
> Acked-by: Sagar Dharia <sdharia@codeaurora.org>
> Signed-off-by: Gilad Avidov <gavidov@codeaurora.org
> 

<snip>

> @@ -645,12 +796,67 @@ static int spmi_pmic_arb_probe(struct platform_device *pdev)
>         pa->spmic = ctrl;
> 
>         res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "core");
> -       pa->base = devm_ioremap_resource(&ctrl->dev, res);
> -       if (IS_ERR(pa->base)) {
> -               err = PTR_ERR(pa->base);
> +       core = devm_ioremap_resource(&ctrl->dev, res);
> +       if (IS_ERR(core)) {
> +               err = PTR_ERR(core);
>                 goto err_put_ctrl;
>         }
> 
> +       hw_ver = readl_relaxed(core + PMIC_ARB_VERSION);
> +       is_v1  = (hw_ver < PMIC_ARB_VERSION_V2_MIN);
> +
> +       dev_info(&ctrl->dev, "PMIC Arb Version-%d (0x%x)\n", (is_v1 ? 1 : 2),
> +               hw_ver);
> +
> +       if (is_v1) {
> +               pa->ver_ops = &pmic_arb_v1;
> +               pa->wr_base = core;
> +               pa->rd_base = core;
> +       } else {
> +               u8  chan;
> +               u16 ppid;
> +               u32 regval;
> +
> +               pa->ver_ops = &pmic_arb_v2;
> +               devm_iounmap(&ctrl->dev, core);
> +
> +               pa->ppid_to_chan = devm_kzalloc(&ctrl->dev,
> +                                       PPID_TO_CHAN_TABLE_SZ, GFP_KERNEL);
> +               if (!pa->ppid_to_chan) {
> +                       err = -ENOMEM;
> +                       goto err_put_ctrl;
> +               }
> +               /*
> +                       * PMIC_ARB_REG_CHNL is a table in HW mapping channel to ppid.
> +                       * ppid_to_chan is an in-memory invert of that table.
> +                       */
> +               for (chan = 0; chan < PMIC_ARB_MAX_CHNL; ++chan) {
> +                       regval = readl_relaxed(pa->rd_base +

rd_base is not initialized at this point.

> +                                                                                               
> PMIC_ARB_REG_CHNL(chan));
> +                       if (!regval)
> +                               continue;
> +
> +                       ppid = (regval >> 8) & 0xFFF;
> +                       pa->ppid_to_chan[ppid] = chan;
> +               }
> +
> +               res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
> +                                                                       "obsrvr");
> +               pa->rd_base = devm_ioremap_resource(&ctrl->dev, res);

and they are compile warnings:

drivers/spmi/spmi-pmic-arb.c: In function ‘pmic_arb_read_cmd’:
drivers/spmi/spmi-pmic-arb.c:310:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat=]
    PMIC_ARB_MAX_TRANS_BYTES, len);
    ^
drivers/spmi/spmi-pmic-arb.c: In function ‘pmic_arb_write_cmd’:
drivers/spmi/spmi-pmic-arb.c:357:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat=]
    PMIC_ARB_MAX_TRANS_BYTES, len);
    ^

Ivan

  reply	other threads:[~2015-02-23  9:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-19 22:54 [PATCH V4 0/2] [PATCH V4 0/2] add support for pmic_arb v2 and correct framework Gilad Avidov
2015-02-19 22:54 ` [PATCH V4 1/2] spmi: remove wakeup command before slave probe Gilad Avidov
2015-02-19 22:54 ` [PATCH V4 2/2] spmi: pmic_arb: add support for hw version 2 Gilad Avidov
2015-02-23  9:59   ` Ivan T. Ivanov [this message]
2015-03-10 10:51     ` Ivan T. Ivanov
2015-03-11 23:43     ` Gilad Avidov
2015-02-23 16:06   ` Ivan T. Ivanov
2015-03-11 22:55     ` Gilad Avidov
2015-02-24 11:01   ` Ivan T. Ivanov
2015-03-11 19:05     ` Gilad Avidov

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=1424685554.2340.2.camel@mm-sol.com \
    --to=iivanov@mm-sol.com \
    --cc=agross@codeaurora.org \
    --cc=galak@codeaurora.org \
    --cc=gavidov@codeaurora.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlocke@codeaurora.org \
    --cc=sdharia@codeaurora.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 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.