From: Jagan Teki <jagan@amarulasolutions.com>
To: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
devicetree <devicetree@vger.kernel.org>,
Michael Trimarchi <michael@amarulasolutions.com>,
linux-sunxi <linux-sunxi@googlegroups.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
Chen-Yu Tsai <wens@csie.org>, Rob Herring <robh+dt@kernel.org>,
Yong Deng <yong.deng@magewell.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-amarula@amarulasolutions.com,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
linux-media <linux-media@vger.kernel.org>
Subject: Re: [PATCH v5 2/6] media: sun6i: Add mod_rate quirk
Date: Sun, 6 Jan 2019 22:00:56 +0530 [thread overview]
Message-ID: <CAMty3ZBeopJTm7kUzqarSfqYAJup7B5eqVWPg4aRpgFJOWP7XA@mail.gmail.com> (raw)
In-Reply-To: <CAMty3ZCG5cF3tP2mid5xyS=yhtxkY+TOcGkwRkv+vrZt1=0iQg@mail.gmail.com>
On Mon, Dec 24, 2018 at 8:57 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> On Fri, Dec 21, 2018 at 6:30 PM Maxime Ripard <maxime.ripard@bootlin.com> wrote:
> >
> > On Thu, Dec 20, 2018 at 06:24:34PM +0530, Jagan Teki wrote:
> > > Unfortunately default CSI_SCLK rate cannot work properly to
> > > drive the connected sensor interface, particularly on few
> > > Allwinner SoC's like A64.
> > >
> > > So, add mod_rate quirk via driver data so-that the respective
> > > SoC's which require to alter the default mod clock rate can assign
> > > the operating clock rate.
> > >
> > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > > ---
> > > .../platform/sunxi/sun6i-csi/sun6i_csi.c | 34 +++++++++++++++----
> > > 1 file changed, 28 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
> > > index ee882b66a5ea..fe002beae09c 100644
> > > --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
> > > +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
> > > @@ -15,6 +15,7 @@
> > > #include <linux/ioctl.h>
> > > #include <linux/module.h>
> > > #include <linux/of.h>
> > > +#include <linux/of_device.h>
> > > #include <linux/platform_device.h>
> > > #include <linux/pm_runtime.h>
> > > #include <linux/regmap.h>
> > > @@ -28,8 +29,13 @@
> > >
> > > #define MODULE_NAME "sun6i-csi"
> > >
> > > +struct sun6i_csi_variant {
> > > + unsigned long mod_rate;
> > > +};
> > > +
> > > struct sun6i_csi_dev {
> > > struct sun6i_csi csi;
> > > + const struct sun6i_csi_variant *variant;
> > > struct device *dev;
> > >
> > > struct regmap *regmap;
> > > @@ -822,33 +828,43 @@ static int sun6i_csi_resource_request(struct sun6i_csi_dev *sdev,
> > > return PTR_ERR(sdev->clk_mod);
> > > }
> > >
> > > + if (sdev->variant->mod_rate)
> > > + clk_set_rate_exclusive(sdev->clk_mod, sdev->variant->mod_rate);
> > > +
> >
> > It still doesn't make any sense to do it in the probe function...
>
> I'm not sure we discussed about the context wrt probe, we discussed
> about exclusive put clock. Since clocks were enabling in set_power and
> clock rate can be set during probe in single time instead of setting
> it in set_power for every power enablement. anything wrong with that.
>
> >
> > We discussed this in the previous iteration already.
> >
> > What we didn't discuss is the variant function that you introduce,
> > while the previous approach was enough.
>
> We discussed about clk_rate_exclusive_put, and that even handle it in
> .remove right? so I have variant to handle it in sun6i_csi_remove.
Any comments?
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-01-06 16:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-20 12:54 [PATCH v5 0/6] media/sun6i: Allwinner A64 CSI support Jagan Teki
2018-12-20 12:54 ` [PATCH v5 1/6] dt-bindings: media: sun6i: Add A64 CSI compatible Jagan Teki
2018-12-20 12:54 ` [PATCH v5 2/6] media: sun6i: Add mod_rate quirk Jagan Teki
2018-12-21 13:00 ` Maxime Ripard
2018-12-24 15:27 ` Jagan Teki
2019-01-06 16:30 ` Jagan Teki [this message]
2019-01-07 13:29 ` Maxime Ripard
2019-01-11 6:05 ` Jagan Teki
2019-01-11 6:24 ` Jagan Teki
2019-01-16 11:11 ` Maxime Ripard
2019-01-17 4:34 ` Jagan Teki
2018-12-20 12:54 ` [PATCH v5 3/6] media: sun6i: Add A64 CSI block support Jagan Teki
2018-12-20 12:54 ` [PATCH v5 4/6] arm64: dts: allwinner: a64: Add A64 CSI controller Jagan Teki
2018-12-20 12:54 ` [PATCH v5 5/6] arm64: dts: allwinner: a64: Add pinmux setting for CSI MCLK on PE1 Jagan Teki
2018-12-20 12:54 ` [DO NOT MERGE] [PATCH v5 6/6] arm64: dts: allwinner: bananapi-m64: Add HDF5640 camera module Jagan Teki
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=CAMty3ZBeopJTm7kUzqarSfqYAJup7B5eqVWPg4aRpgFJOWP7XA@mail.gmail.com \
--to=jagan@amarulasolutions.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-amarula@amarulasolutions.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-sunxi@googlegroups.com \
--cc=mark.rutland@arm.com \
--cc=maxime.ripard@bootlin.com \
--cc=mchehab@kernel.org \
--cc=michael@amarulasolutions.com \
--cc=robh+dt@kernel.org \
--cc=wens@csie.org \
--cc=yong.deng@magewell.com \
/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).