From: Heiko Stuebner <heiko@sntech.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Wen Nuan <leo.wen@rock-chips.com>,
David Wu <david.wu@rock-chips.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Greg KH <gregkh@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
jacob2.chen@rock-chips.com,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-media@vger.kernel.org, Eddie Cai <eddie.cai@rock-chips.com>
Subject: Re: [PATCH V2 1/2] [media] Add Rockchip RK1608 driver
Date: Mon, 26 Feb 2018 16:15:44 +0100 [thread overview]
Message-ID: <3613277.0XuNfbW5nk@phil> (raw)
In-Reply-To: <CACRpkdZDWvqrpop9FaJUidJjR8jB=Db-WztePrqKSg5Yp5gvCA@mail.gmail.com>
Hi Linus,
thanks for catching these things :-) .
Am Montag, 26. Februar 2018, 11:12:30 CET schrieb Linus Walleij:
> On Mon, Feb 26, 2018 at 9:16 AM, Wen Nuan <leo.wen@rock-chips.com> wrote:
> > + pdata->grf_gpio2b_iomux = ioremap((resource_size_t)
> > + (GRF_BASE_ADDR +
> > + GRF_GPIO2B_IOMUX), 4);
> > + grf_val = __raw_readl(pdata->grf_gpio2b_iomux);
> > + __raw_writel(((grf_val) | (1 << 6) | (1 << (6 + 16))),
> > + pdata->grf_gpio2b_iomux);
> > +
> > + pdata->grf_io_vsel = ioremap((resource_size_t)
> > + (GRF_BASE_ADDR + GRF_IO_VSEL), 4);
> > + grf_val = __raw_readl(pdata->grf_io_vsel);
> > + __raw_writel(((grf_val) | (1 << 1) | (1 << (1 + 16))),
> > + pdata->grf_io_vsel);
>
> You are doing pin control on the side of the pin control subsystem
> it looks like?
>
> I think David Wu and Heiko Stubner needs to have a look at what you
> are doing here to suggest other solutions.
Especially as the rk1608 seems to be some a spi-connected peripheral.
So it should definitly not touch _any_ soc-specific registers at all.
I just looked up the patch in patchwork and apart from the one Linus
quoted above, I found quite a bit more open-coded pinctrl settings
as well as direct writes to the clock controller and even io-voltage
selections.
All these things are highly soc-specific so vary with each soc this
ic gets connected to and the kernel does provide abstractions for
all of them. For clock-rates there are the clock-apis and also
the assigned-clock* properties for the devicetree, pinctrl supports
multiple states and io-vsel selections normally should just monitor
the supply-regulator via the io-domain driver we already have
[See vqmmc handling in for sd-cards for example].
So this driver should not touch anything of that sort and therefore
should _not_ contain any iomem-based read or write at all.
Heiko
next prev parent reply other threads:[~2018-02-26 15:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-26 8:16 [PATCH V2 0/2] Rockchip: Add RK1608 driver and DT-bindings Wen Nuan
2018-02-26 8:16 ` [PATCH V2 1/2] [media] Add Rockchip RK1608 driver Wen Nuan
2018-02-26 9:50 ` Hans Verkuil
2018-02-26 10:12 ` Linus Walleij
2018-02-26 15:15 ` Heiko Stuebner [this message]
2018-02-27 3:15 ` 温暖
2018-02-27 15:12 ` Heiko Stuebner
2018-02-28 1:23 ` 回复: " 温暖
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=3613277.0XuNfbW5nk@phil \
--to=heiko@sntech.de \
--cc=davem@davemloft.net \
--cc=david.wu@rock-chips.com \
--cc=eddie.cai@rock-chips.com \
--cc=gregkh@linuxfoundation.org \
--cc=jacob2.chen@rock-chips.com \
--cc=leo.wen@rock-chips.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=rdunlap@infradead.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.