From: Lucas Stach <l.stach@pengutronix.de>
To: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Cc: heiko@sntech.de, dri-devel@lists.freedesktop.org,
ykk@rock-chips.com, devel@driverdev.osuosl.org,
linux-rockchip@lists.infradead.org,
Grant Likely <grant.likely@linaro.org>,
Dave Airlie <airlied@redhat.com>,
jay.xu@rock-chips.com, devicetree@vger.kernel.org,
Arnd Bergmann <arnd@arndb.de>, Rob Herring <robh+dt@kernel.org>,
rmk+kernel@arm.linux.org.uk, fabio.estevam@freescale.com,
Josh Boyer <jwboyer@redhat.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, djkurtz@google.com,
Andy Yan <andy.yan@rock-chips.com>
Subject: Re: [PATCH v7 5/7] drm: bridge/dw-hdmi: add support for multi byte register width access
Date: Tue, 11 Nov 2014 15:23:40 +0100 [thread overview]
Message-ID: <1415715820.2815.9.camel@pengutronix.de> (raw)
In-Reply-To: <54621B23.1020602@imgtec.com>
Am Dienstag, den 11.11.2014, 14:20 +0000 schrieb Zubair Lutfullah
Kakakhel:
> Hi Andy,
>
> This patch adds the reg-io-width binding.
>
> Hence the binding patch should come before it.
>
>
> On 11/11/14 12:53, Andy Yan wrote:
> > On rockchip rk3288, only word(32-bit) accesses are
> > permitted for hdmi registers. Byte width accesses (writeb,
> > readb) generate an imprecise external abort.
> >
> > Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
> >
> > ---
> >
> > }
> >
> > static void hdmi_modb(struct dw_hdmi *hdmi, u8 data, u8 mask, unsigned reg)
> > @@ -1499,6 +1527,23 @@ static int dw_hdmi_bind(struct device *dev, struct device *master, void *data)
> > struct device_node *ddc_node;
> > struct resource *iores;
> > int ret, irq;
> > + u32 val = 1;
> > +
> > + of_property_read_u32(np, "reg-io-width", &val);
> > +
> > + switch (val) {
> > + case 4:
> > + hdmi->write = dw_hdmi_writel;
> > + hdmi->read = dw_hdmi_readl;
> > + break;
> > + case 1:
> > + hdmi->write = dw_hdmi_writeb;
> > + hdmi->read = dw_hdmi_readb;
> > + break;
> > + default:
> > + dev_err(dev, "reg-io-width must be 1 or 4\n");
> > + return -EINVAL;
> > + }
>
> The binding patch says this is an optional property.
> But here if undefined it returns -EINVAL.
>
> I would keep it optional and default it to byte access.
That's exactly what the patch does. val is initialized to 1, which is
not changed if the property could not be found in the DT. The default
case will only be taken if the property is present in DT but has any
other value than 1 or 4, which is an error.
Regards,
Lucas
--
Pengutronix e.K. | Lucas Stach |
Industrial Linux Solutions | http://www.pengutronix.de/ |
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2014-11-11 14:23 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-11 12:48 [PATCH v7 0/7] dw-hdmi: convert imx hdmi to bridge/dw-hdmi Andy Yan
[not found] ` <1415710124-11887-1-git-send-email-andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2014-11-11 12:50 ` [PATCH v7 1/7] staging: imx-drm: imx-hdmi: make checkpatch happy Andy Yan
[not found] ` <1415710229-11935-1-git-send-email-andy.yan-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2014-11-11 12:51 ` [PATCH v7 2/7] staging: imx-drm: imx-hdmi: return defer if can't get ddc i2c adapter Andy Yan
2014-11-11 12:52 ` [PATCH v7 3/7] staging: imx-drm: imx-hdmi: split imx soc specific code from imx-hdmi Andy Yan
2014-11-11 12:53 ` [PATCH v7 4/7] staging: imx-drm: imx-hdmi: move imx-hdmi to bridge/dw-hdmi Andy Yan
2014-11-11 14:16 ` Zubair Lutfullah Kakakhel
[not found] ` <54621A3D.9090406-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2014-11-11 14:41 ` Andy Yan
2014-11-11 12:53 ` [PATCH v7 5/7] drm: bridge/dw-hdmi: add support for multi byte register width access Andy Yan
2014-11-11 14:20 ` Zubair Lutfullah Kakakhel
2014-11-11 14:23 ` Lucas Stach [this message]
2014-11-11 14:37 ` Zubair Lutfullah Kakakhel
2014-11-11 14:46 ` Andy Yan
2014-11-11 14:48 ` Zubair Lutfullah Kakakhel
2014-11-11 12:54 ` [PATCH v7 6/7] drm: bridge/dw-hdmi: convert dw-hdmi to drm_bridge mode Andy Yan
2014-11-11 14:36 ` Zubair Lutfullah Kakakhel
2014-11-11 14:50 ` Andy Yan
2014-11-11 12:54 ` [PATCH v7 7/7] dt-bindings: add document for dw-hdmi Andy Yan
2014-11-11 14:40 ` Zubair Lutfullah Kakakhel
2014-11-11 14:53 ` Andy Yan
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=1415715820.2815.9.camel@pengutronix.de \
--to=l.stach@pengutronix.de \
--cc=Zubair.Kakakhel@imgtec.com \
--cc=airlied@redhat.com \
--cc=andy.yan@rock-chips.com \
--cc=arnd@arndb.de \
--cc=devel@driverdev.osuosl.org \
--cc=devicetree@vger.kernel.org \
--cc=djkurtz@google.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=fabio.estevam@freescale.com \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=heiko@sntech.de \
--cc=jay.xu@rock-chips.com \
--cc=jwboyer@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=rmk+kernel@arm.linux.org.uk \
--cc=robh+dt@kernel.org \
--cc=ykk@rock-chips.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).