From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: "Ivan T. Ivanov" <iivanov@mm-sol.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH 2/4] Input: pmic8xxx-keypad - use regmap_field for register access
Date: Tue, 7 Oct 2014 10:26:06 -0700 [thread overview]
Message-ID: <20141007172606.GG16469@dtor-ws> (raw)
In-Reply-To: <1412675448-11990-3-git-send-email-iivanov@mm-sol.com>
Hi Ivan,
On Tue, Oct 07, 2014 at 12:50:46PM +0300, Ivan T. Ivanov wrote:
> @@ -527,10 +538,55 @@ static int pmic8xxx_kp_probe(struct platform_device *pdev)
>
> platform_set_drvdata(pdev, kp);
>
> + if (rows < info->min_rows)
> + rows = info->min_rows;
> +
> + if (cols < info->min_cols)
> + cols = info->min_cols;
> +
> kp->num_rows = rows;
> kp->num_cols = cols;
> kp->dev = &pdev->dev;
>
> + kp->events = devm_regmap_field_alloc(kp->dev, kp->regmap,
> + info->events);
> + if (IS_ERR(kp->events))
> + return PTR_ERR(kp->events);
> +
> + kp->scan_rows = devm_regmap_field_alloc(kp->dev, kp->regmap,
> + info->scan_rows);
> + if (IS_ERR(kp->scan_rows))
> + return PTR_ERR(kp->scan_rows);
> +
> + kp->scan_cols = devm_regmap_field_alloc(kp->dev, kp->regmap,
> + info->scan_cols);
> + if (IS_ERR(kp->scan_cols))
> + return PTR_ERR(kp->scan_cols);
> +
> + kp->enable = devm_regmap_field_alloc(kp->dev, kp->regmap,
> + info->enable);
> + if (IS_ERR(kp->enable))
> + return PTR_ERR(kp->enable);
> +
> + kp->read_state = devm_regmap_field_alloc(kp->dev, kp->regmap,
> + info->read_state);
> + if (IS_ERR(kp->read_state))
> + return PTR_ERR(kp->read_state);
> +
> + kp->dbonce = devm_regmap_field_alloc(kp->dev, kp->regmap,
> + info->dbonce);
> + if (IS_ERR(kp->dbonce))
> + return PTR_ERR(kp->dbonce);
> +
> + kp->pause = devm_regmap_field_alloc(kp->dev, kp->regmap, info->pause);
> + if (IS_ERR(kp->pause))
> + return PTR_ERR(kp->pause);
> +
> + kp->row_hold = devm_regmap_field_alloc(kp->dev, kp->regmap,
> + info->row_hold);
> + if (IS_ERR(kp->row_hold))
> + return PTR_ERR(kp->row_hold);
Why do we have to allocate all regmap fields separately instead of
embedding them into keypad structure?
Thanks.
--
Dmitry
next prev parent reply other threads:[~2014-10-07 17:26 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1412675448-11990-1-git-send-email-iivanov@mm-sol.com>
2014-10-07 9:50 ` [PATCH 1/4] Input: pmic8xxx-keypad - remove unused register and bit definitions Ivan T. Ivanov
2014-10-07 9:50 ` [PATCH 2/4] Input: pmic8xxx-keypad - use regmap_field for register access Ivan T. Ivanov
2014-10-07 17:26 ` Dmitry Torokhov [this message]
2014-10-08 9:13 ` Ivan T. Ivanov
2014-10-08 9:30 ` Ivan T. Ivanov
2014-10-08 18:00 ` Stephen Boyd
2014-10-08 18:13 ` Dmitry Torokhov
2014-10-08 18:20 ` Stephen Boyd
2014-10-08 20:04 ` Mark Brown
2014-10-08 20:32 ` Dmitry Torokhov
2014-10-13 14:02 ` Mark Brown
2014-10-27 15:30 ` Ivan T. Ivanov
2014-10-27 16:06 ` Dmitry Torokhov
2014-10-27 16:20 ` Ivan T. Ivanov
2014-10-27 16:26 ` Dmitry Torokhov
[not found] ` <1412675448-11990-1-git-send-email-iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
2014-10-07 9:50 ` [PATCH 3/4] Input: pmic8xxx-keypad - add support keypad found in pm8941 Ivan T. Ivanov
2014-10-07 9:50 ` [PATCH 4/4] Input: pmic8xxx-keypad - update DT bindings documentation Ivan T. Ivanov
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=20141007172606.GG16469@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=iivanov@mm-sol.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sboyd@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 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).