All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org
Subject: Re: [PATCH] gpio: twl4030: Correct status reporting when the GPIO is used as output
Date: Thu, 6 Dec 2012 11:55:00 +0100	[thread overview]
Message-ID: <50C07984.8000003@ti.com> (raw)
In-Reply-To: <20121205224813.584123E0E22@localhost>

On 12/05/2012 11:48 PM, Grant Likely wrote:
>> -	base = REG_GPIODATAIN1 + d_bnk;
>> +	direction = gpio_twl4030_read(REG_GPIODATADIR1 + d_bnk);
>> +	if (direction > 0 && (direction >> d_off) & 0x1)
>> +		base = REG_SETGPIODATAOUT1 + d_bnk;
>> +	else
>> +		base = REG_GPIODATAIN1 + d_bnk;
>> +
> 
> This is probably quite expensive considering that reads need to go out
> the i2c bus. Things like the output state and the pin direction should
> be cached by the driver in its private data structure so that you don't
> add an additional i2c round trip.

True. I have sent the v2, which grown a bit since I did not wanted to add more
global variable to this driver.

-- 
Péter
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	<linux-kernel@vger.kernel.org>, <linux-omap@vger.kernel.org>
Subject: Re: [PATCH] gpio: twl4030: Correct status reporting when the GPIO is used as output
Date: Thu, 6 Dec 2012 11:55:00 +0100	[thread overview]
Message-ID: <50C07984.8000003@ti.com> (raw)
In-Reply-To: <20121205224813.584123E0E22@localhost>

On 12/05/2012 11:48 PM, Grant Likely wrote:
>> -	base = REG_GPIODATAIN1 + d_bnk;
>> +	direction = gpio_twl4030_read(REG_GPIODATADIR1 + d_bnk);
>> +	if (direction > 0 && (direction >> d_off) & 0x1)
>> +		base = REG_SETGPIODATAOUT1 + d_bnk;
>> +	else
>> +		base = REG_GPIODATAIN1 + d_bnk;
>> +
> 
> This is probably quite expensive considering that reads need to go out
> the i2c bus. Things like the output state and the pin direction should
> be cached by the driver in its private data structure so that you don't
> add an additional i2c round trip.

True. I have sent the v2, which grown a bit since I did not wanted to add more
global variable to this driver.

-- 
Péter

  reply	other threads:[~2012-12-06 10:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-05  9:49 [PATCH] gpio: twl4030: Correct status reporting when the GPIO is used as output Peter Ujfalusi
2012-12-05  9:49 ` Peter Ujfalusi
2012-12-05 22:48 ` Grant Likely
2012-12-06 10:55   ` Peter Ujfalusi [this message]
2012-12-06 10:55     ` Peter Ujfalusi

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=50C07984.8000003@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.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.