linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Jun Nie <jun.nie@linaro.org>
Cc: Haojian Zhuang <haojian.zhuang@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio@vger.kernel.org, Shawn Guo <shawn.guo@linaro.org>,
	"wan.zhijun" <wan.zhijun@zte.com.cn>,
	Jason Liu <jason.liu@linaro.org>
Subject: Re: [PATCH] pinctrl: single: support GPIO for bits pinctrl
Date: Tue, 23 Jun 2015 03:14:16 -0700	[thread overview]
Message-ID: <20150623101415.GV20628@atomide.com> (raw)
In-Reply-To: <CABymUCPb7ouZ8DVww=d=K87tkS13Qr1CuGs0+Qnb4skD7_0g2g@mail.gmail.com>

* Jun Nie <jun.nie@linaro.org> [150623 02:56]:
> 2015-06-17 15:17 GMT+08:00 Tony Lindgren <tony@atomide.com>:
> > * Jun Nie <jun.nie@linaro.org> [150616 18:58]:
> >> +             if (pcs->bits_per_mux) {
> >> +                     int pin_pos, byte_num, num_pins_in_register;
> >> +
> >> +                     num_pins_in_register = pcs->width / pcs->bits_per_pin;
> >> +                     byte_num = (pcs->bits_per_pin * pin) / BITS_PER_BYTE;
> >> +                     offset = (byte_num / mux_bytes) * mux_bytes;
> >> +                     pin_pos = pin % num_pins_in_register;
> >> +                     pin_pos *= pcs->bits_per_pin;
> >> +                     data = pcs->read(pcs->base + offset) &
> >> +                             ~(pcs->fmask << pin_pos);
> >
> > Should you check the pcs->fmask here too in case some bits are reserved?
> >
> Did not catch your idea? Those bits set in fmask are dedicated for one
> pin mux control and should be clear before set as desired value per my
> understanding. Do you mean some bits may be reserved and not for any
> function?

Right, can you please check that we don't try to write to reserved
bits in the hardawre if the mask is set?

Regards,

Tony

  reply	other threads:[~2015-06-23 10:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-17  1:56 [PATCH] pinctrl: single: support GPIO for bits pinctrl Jun Nie
2015-06-17  7:17 ` Tony Lindgren
2015-06-19 14:55   ` Haojian Zhuang
2015-06-23  9:54   ` Jun Nie
2015-06-23 10:14     ` Tony Lindgren [this message]
2015-06-23 10:18       ` Jun Nie
2015-07-06  8:40         ` Jun Nie
2015-07-06  9:03           ` Tony Lindgren
2015-07-06  9:19             ` Jun Nie
2015-07-06 10:40               ` Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2015-06-12  8:19 Jun Nie
2015-06-16  9:17 ` Linus Walleij
2015-06-16 11:28   ` Tony Lindgren

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=20150623101415.GV20628@atomide.com \
    --to=tony@atomide.com \
    --cc=haojian.zhuang@linaro.org \
    --cc=jason.liu@linaro.org \
    --cc=jun.nie@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=shawn.guo@linaro.org \
    --cc=wan.zhijun@zte.com.cn \
    /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).