linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Reid <preid@electromag.com.au>
To: Tim Sander <tim@krieglstein.org>,
	Jarkko Nikula <jarkko.nikula@linux.intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Wolfram Sang <wsa@the-dreams.de>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: RFC: i2c designware gpio recovery
Date: Mon, 1 May 2017 09:57:35 +0800	[thread overview]
Message-ID: <25752a11-3b13-762f-5916-66893d223988@electromag.com.au> (raw)
In-Reply-To: <2269277.HqpbCE3B5H@dabox>

G'day Tim,


On 29/04/2017 00:14, Tim Sander wrote:
> Hi
> 
> After sending this mail i just found out how i could reset the i2c-1 controller manually with
> devmem 0xffd05014 32 0x2000
> devmem 0xffd05014 32 0
> 
> So i took a look into the device tree file socfpga.dtsi and found that the reset lines
> where not defined (although available in the corresponding reset manager). Is there a
> reason for this? Other components are connected.
There's a few thing like that where the bootloader has been expected to setup the resets etc.


> 
> However with the patch below my previously sent patch works!
> 
> If there is interest in would cleanup the patch and send it in for mainlining.
> I think the most unacceptable part would be this line:
> +       ret = gpio_request_one(bri->scl_gpio, //GPIOF_OPEN_DRAIN |
> My gpio drivers refuse to work as output as they have no open drain mode.
> So i wonder how to get this solved in a clean manner.
I thought the gpio system would emulate open drain by switching the pin between an
input and output driven low in this case. How are you configuring the GPIO's in the
FPGA?



> 
> Best regards
> Tim
> ---
>   arch/arm/boot/dts/socfpga.dtsi | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/socfpga.dtsi b/arch/arm/boot/dts/socfpga.dtsi
> index 2c43c4d85dee..5f28632bc88c 100644
> --- a/arch/arm/boot/dts/socfpga.dtsi
> +++ b/arch/arm/boot/dts/socfpga.dtsi
> @@ -643,6 +643,7 @@
>                          #size-cells = <0>;
>                          compatible = "snps,designware-i2c";
>                          reg = <0xffc04000 0x1000>;
> +                       resets = <&rst I2C0_RESET>;
>                          clocks = <&l4_sp_clk>;
>                          interrupts = <0 158 0x4>;
>                          status = "disabled";
> @@ -653,6 +654,7 @@
>                          #size-cells = <0>;
>                          compatible = "snps,designware-i2c";
>                          reg = <0xffc05000 0x1000>;
> +                       resets = <&rst I2C1_RESET>;
>                          clocks = <&l4_sp_clk>;
>                          interrupts = <0 159 0x4>;
>                          status = "disabled";
> @@ -663,6 +665,7 @@
>                          #size-cells = <0>;
>                          compatible = "snps,designware-i2c";
>                          reg = <0xffc06000 0x1000>;
> +                       resets = <&rst I2C2_RESET>;
>                          clocks = <&l4_sp_clk>;
>                          interrupts = <0 160 0x4>;
>                          status = "disabled";
> @@ -673,6 +676,7 @@
>                          #size-cells = <0>;
>                          compatible = "snps,designware-i2c";
>                          reg = <0xffc07000 0x1000>;
> +                       resets = <&rst I2C3_RESET>;
>                          clocks = <&l4_sp_clk>;
>                          interrupts = <0 161 0x4>;
>                          status = "disabled";
> 


-- 
Regards
Phil Reid

ElectroMagnetic Imaging Technology Pty Ltd
Development of Geophysical Instrumentation & Software
www.electromag.com.au

3 The Avenue, Midland WA 6056, AUSTRALIA
Ph: +61 8 9250 8100
Fax: +61 8 9250 7100
Email: preid@electromag.com.au

  reply	other threads:[~2017-05-01  2:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-28 15:43 RFC: i2c designware gpio recovery Tim Sander
2017-04-28 16:14 ` Tim Sander
2017-05-01  1:57   ` Phil Reid [this message]
2017-05-01 13:31     ` Tim Sander
2017-05-03  1:30       ` Phil Reid
2017-05-03 19:04         ` Tim Sander
2017-05-10  7:12           ` Phil Reid
2017-05-10 11:57             ` [PATCH] i2c-designware: add i2c gpio recovery option Tim Sander
2017-05-10 13:13               ` Andy Shevchenko
2017-05-11  1:24                 ` Phil Reid
2017-05-11 13:53                   ` Andy Shevchenko
2017-05-11 14:02                     ` Andy Shevchenko
2017-05-12  1:49                     ` Phil Reid
2017-05-12 10:17                       ` Andy Shevchenko
2017-05-01  2:15 ` RFC: i2c designware gpio recovery Phil Reid

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=25752a11-3b13-762f-5916-66893d223988@electromag.com.au \
    --to=preid@electromag.com.au \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=tim@krieglstein.org \
    --cc=wsa@the-dreams.de \
    /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).