linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: Laxman Dewangan <ldewangan@nvidia.com>
Cc: dmitry.torokhov@gmail.com, grant.likely@secretlab.ca,
	rob.herring@calxeda.com, swarren@nvidia.com,
	devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
	linux-tegra@vger.kernel.org
Subject: Re: [PATCH 3/4] input: keyboard: tegra: add support for rows/cols configuration from dt
Date: Fri, 04 Jan 2013 12:50:07 -0700	[thread overview]
Message-ID: <50E7326F.7090201@wwwdotorg.org> (raw)
In-Reply-To: <1357297330-28878-4-git-send-email-ldewangan@nvidia.com>

On 01/04/2013 04:02 AM, Laxman Dewangan wrote:
> The NVIDIA's Tegra KBC has maximum 24 pins to make matrix keypad.
> Any pin can be configured as row or column. The maximum column pin
> can be 8 and maximum row pin can be 16.
> 
> Remove the assumption that all first 16 pins will be used as row
> and remaining as columns and Add the property for configuring pins
> to either row or column from DT. Update the devicetree binding
> document accordingly.

> diff --git a/Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.txt b/Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.txt

>  Required properties:

> +- nvidia,kbc-rows: The KBC pins which are configured as row. This is the
> +  array of pinmnumber.
> +- nvidia,kbc-cols: The KBC pins which are configured as column. This is the
> +  array of pinmnumber.

"the array of pinmnumber" -> "an array of pin numbers"?

I wonder if "row-pins" and "col-pins" would be a better name; "rows" and
"cols" sound like a count not a lines. But perhaps that's just
bike-shedding.

> +	linux,keymap = < 0x00000074
> +			 0x00010067
> +			 0x00020066
> +			 0x01010068
> +			 0x02000069
> +			 0x02010070
> +			 0x02020071 >;

Nit-pick: no space after < or before >. At least, the Tegra DTs are all
currently cleaned up that way.

> diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c

> +	/* Set all pins as non-configured */
> +	for (i = 0; i < KBC_MAX_GPIO; i++) {
>  		pdata->pin_cfg[i].num = i;
> +		pdata->pin_cfg[i].type = PIN_CFG_IGNORE;
> +	}
...
> +	for (i = 0; i < num_rows; i++) {
> +		pdata->pin_cfg[rows_cfg[i]].type = PIN_CFG_ROW;
> +		pdata->pin_cfg[rows_cfg[i]].num = i;

If we're setting up "num" here for the valid rows/cols, then why is the
".num = i" assignment needed in the loop above that sets .type = IGNORE?

>  	}
>  
> +	for (i = 0; i < num_cols; i++) {
> +		pdata->pin_cfg[cols_cfg[i]].type = PIN_CFG_COL;
> +		pdata->pin_cfg[cols_cfg[i]].num = i;
>  	}

> -	if (!pdata) {
> +	if (IS_ERR_OR_NULL(pdata)) {
>  		dev_err(&pdev->dev, "Platform data missing\n");
> -		return -EINVAL;
> +		return (pdata) ? PTR_ERR(pdata) : -EINVAL;

No need for () around the first use of pdata there.


      reply	other threads:[~2013-01-04 19:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-04 11:02 [PATCH 0/4] input: keyboard: tegra: cleanups and DT supports Laxman Dewangan
     [not found] ` <1357297330-28878-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-01-04 11:02   ` [PATCH 1/4] input: keyboard: tegra: fix build warning Laxman Dewangan
2013-01-04 11:02   ` [PATCH 2/4] input: keyboard: tegra: use devm_* for resource allocation Laxman Dewangan
2013-01-04 11:02   ` [PATCH 4/4] input: keyboard: tegra: remove default key mapping Laxman Dewangan
     [not found]     ` <1357297330-28878-5-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-01-04 19:52       ` Stephen Warren
2013-01-05  7:20         ` Laxman Dewangan
2013-01-04 11:02 ` [PATCH 3/4] input: keyboard: tegra: add support for rows/cols configuration from dt Laxman Dewangan
2013-01-04 19:50   ` Stephen Warren [this message]

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=50E7326F.7090201@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=grant.likely@secretlab.ca \
    --cc=ldewangan@nvidia.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=rob.herring@calxeda.com \
    --cc=swarren@nvidia.com \
    /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).