All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Wahren <stefan.wahren@i2se.com>
To: Baruch Siach <baruch@tkos.co.il>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Eric Anholt <eric@anholt.net>,
	Dave Stevenson <dave.stevenson@raspberrypi.org>,
	linux-gpio@vger.kernel.org, linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	phil@raspberrypi.org
Subject: Re: [PATCH 3/4] bcm2835-gpio-exp: Driver for GPIO expander via mailbox service
Date: Tue, 9 Jan 2018 21:15:48 +0100 (CET)	[thread overview]
Message-ID: <1723770444.122196.1515528948685@email.1und1.de> (raw)
In-Reply-To: <20180109134135.32i6slkhmqsjnmne@tarshish>

Hi Baruch,

> Baruch Siach <baruch@tkos.co.il> hat am 9. Januar 2018 um 14:41 geschrieben:
> 
> 
> Hi Stefan,
> 
> On Tue, Jan 02, 2018 at 07:49:44PM +0100, Stefan Wahren wrote:
> 
> [...]
> 
> > > +	ret = rpi_firmware_property(gpio->fw, RPI_FIRMWARE_GET_GPIO_CONFIG,
> > > +				    &get, sizeof(get));
> > > +	if (ret) {
> > > +		dev_err(gpio->dev,
> > > +			"Failed to get GPIO %u config (%d)\n", off, ret);
> > > +		return ret;
> > > +	}
> > 
> > Shouldn't we also check the in-bound status at get.gpio?
> 
> What is the in-bound status value? May you refer me to the documentation?

unfortunately this mailbox property isn't documented here [1]. So please refer to Phil's explanation [2].

I assume gpio_get_config.gpio of the response would be 0x80000000 in case of an invalid request. But i didn't test it yet.

This was my solution [3] for the RPI_FIRMWARE_GET_CUSTOMER_OTP. But it hadn't been reviewed yet.

Stefan

[1] - https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface
[2] - http://lists.infradead.org/pipermail/linux-rpi-kernel/2018-January/007237.html
[3] - https://github.com/lategoodbye/rpi-zero/blob/bcm2835-otp/drivers/nvmem/raspberrypi-otp.c#L61

> 
> > And in all the other gpio ops?
> 
> Thanks,
> baruch
> 
> -- 
>      http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
> =}------------------------------------------------ooO--U--Ooo------------{=
>    - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: stefan.wahren@i2se.com (Stefan Wahren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/4] bcm2835-gpio-exp: Driver for GPIO expander via mailbox service
Date: Tue, 9 Jan 2018 21:15:48 +0100 (CET)	[thread overview]
Message-ID: <1723770444.122196.1515528948685@email.1und1.de> (raw)
In-Reply-To: <20180109134135.32i6slkhmqsjnmne@tarshish>

Hi Baruch,

> Baruch Siach <baruch@tkos.co.il> hat am 9. Januar 2018 um 14:41 geschrieben:
> 
> 
> Hi Stefan,
> 
> On Tue, Jan 02, 2018 at 07:49:44PM +0100, Stefan Wahren wrote:
> 
> [...]
> 
> > > +	ret = rpi_firmware_property(gpio->fw, RPI_FIRMWARE_GET_GPIO_CONFIG,
> > > +				    &get, sizeof(get));
> > > +	if (ret) {
> > > +		dev_err(gpio->dev,
> > > +			"Failed to get GPIO %u config (%d)\n", off, ret);
> > > +		return ret;
> > > +	}
> > 
> > Shouldn't we also check the in-bound status at get.gpio?
> 
> What is the in-bound status value? May you refer me to the documentation?

unfortunately this mailbox property isn't documented here [1]. So please refer to Phil's explanation [2].

I assume gpio_get_config.gpio of the response would be 0x80000000 in case of an invalid request. But i didn't test it yet.

This was my solution [3] for the RPI_FIRMWARE_GET_CUSTOMER_OTP. But it hadn't been reviewed yet.

Stefan

[1] - https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface
[2] - http://lists.infradead.org/pipermail/linux-rpi-kernel/2018-January/007237.html
[3] - https://github.com/lategoodbye/rpi-zero/blob/bcm2835-otp/drivers/nvmem/raspberrypi-otp.c#L61

> 
> > And in all the other gpio ops?
> 
> Thanks,
> baruch
> 
> -- 
>      http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
> =}------------------------------------------------ooO--U--Ooo------------{=
>    - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2018-01-09 20:16 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-02 13:19 [PATCH 0/4] gpio: driver for the RPi3 GPIO expander Baruch Siach
2018-01-02 13:19 ` Baruch Siach
2018-01-02 13:19 ` [PATCH 1/4] ARM: bcm2835: sync firmware properties with downstream Baruch Siach
2018-01-02 13:19   ` Baruch Siach
2018-01-02 13:19 ` [PATCH 2/4] dt-bindings: gpio: add raspberry pi GPIO expander binding Baruch Siach
2018-01-02 13:19   ` Baruch Siach
2018-01-02 18:26   ` Stefan Wahren
2018-01-02 18:26     ` Stefan Wahren
     [not found]     ` <860502005.181510.1514917560724-7tX72C7vayboQLBSYMtkGA@public.gmane.org>
2018-01-04 19:35       ` Baruch Siach
2018-01-04 19:35         ` Baruch Siach
2018-01-02 13:19 ` [PATCH 3/4] bcm2835-gpio-exp: Driver for GPIO expander via mailbox service Baruch Siach
2018-01-02 13:19   ` Baruch Siach
2018-01-02 18:49   ` Stefan Wahren
2018-01-02 18:49     ` Stefan Wahren
     [not found]     ` <2013811470.181895.1514918984637-7tX72C7vayboQLBSYMtkGA@public.gmane.org>
2018-01-09 13:41       ` Baruch Siach
2018-01-09 13:41         ` Baruch Siach
2018-01-09 20:15         ` Stefan Wahren [this message]
2018-01-09 20:15           ` Stefan Wahren
2018-01-03 10:08   ` Linus Walleij
2018-01-03 10:08     ` Linus Walleij
2018-01-10  3:45     ` Baruch Siach
2018-01-10  3:45       ` Baruch Siach
2018-01-11  9:39       ` Linus Walleij
2018-01-11  9:39         ` Linus Walleij
     [not found] ` <cover.1514898134.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
2018-01-02 13:19   ` [PATCH 4/4] ARM: dts: bcm2837-rpi-3-b: add GPIO expander Baruch Siach
2018-01-02 13:19     ` Baruch Siach
     [not found]     ` <a29df633ee568e150c150debde66c0783a57c70a.1514898134.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
2018-01-02 19:03       ` Stefan Wahren
2018-01-02 19:03         ` Stefan Wahren
     [not found]         ` <1524381852.182115.1514919793281-7tX72C7vayboQLBSYMtkGA@public.gmane.org>
2018-01-03 20:17           ` Stefan Wahren
2018-01-03 20:17             ` Stefan Wahren
2018-01-03 20:29             ` Phil Elwell
2018-01-03 20:29               ` Phil Elwell
     [not found]               ` <3993684b-5b99-6c38-6247-999f7564762b-FnsA7b+Nu9XbIbC87yuRow@public.gmane.org>
2018-01-04  3:06                 ` Peter Robinson
2018-01-04  3:06                   ` Peter Robinson
2018-01-02 18:05   ` [PATCH 0/4] gpio: driver for the RPi3 " Stefan Wahren
2018-01-02 18:05     ` Stefan Wahren

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=1723770444.122196.1515528948685@email.1und1.de \
    --to=stefan.wahren@i2se.com \
    --cc=baruch@tkos.co.il \
    --cc=dave.stevenson@raspberrypi.org \
    --cc=devicetree@vger.kernel.org \
    --cc=eric@anholt.net \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=phil@raspberrypi.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.