From: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: Andy Yan <andy.yan@rock-chips.com>, <airlied@linux.ie>,
<heiko@sntech.de>, <fabio.estevam@freescale.com>,
<rmk+kernel@arm.linux.org.uk>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
Grant Likely <grant.likely@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Shawn Guo <shawn.guo@linaro.org>, Josh Boyer <jwboyer@redhat.com>,
Sean Paul <seanpaul@chromium.org>,
Inki Dae <inki.dae@samsung.com>, Dave Airlie <airlied@redhat.com>,
Arnd Bergmann <arnd@arndb.de>, <djkurtz@google.com>,
<ykk@rock-chips.com>, <linux-kernel@vger.kernel.org>,
<dri-devel@lists.freedesktop.org>, <devel@driverdev.osuosl.org>,
<devicetree@vger.kernel.org>,
<linux-rockchip@lists.infradead.org>, <jay.xu@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 14:37:47 +0000 [thread overview]
Message-ID: <54621F3B.8050103@imgtec.com> (raw)
In-Reply-To: <1415715820.2815.9.camel@pengutronix.de>
On 11/11/14 14:23, Lucas Stach wrote:
> 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.
>
I missed the initialization. My bad.
Thanks
ZubairLK
next prev parent reply other threads:[~2014-11-11 14:37 UTC|newest]
Thread overview: 20+ 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
2014-11-11 12:50 ` [PATCH v7 1/7] staging: imx-drm: imx-hdmi: make checkpatch happy Andy Yan
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
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
2014-11-11 14:37 ` Zubair Lutfullah Kakakhel [this message]
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
-- strict thread matches above, loose matches on Subject: below --
2014-11-11 12:12 [PATCH v7 0/7] dw-hdmi: convert imx hdmi to bridge/dw-hdmi Andy Yan
2014-11-11 12:12 ` [PATCH v7 5/7] drm: bridge/dw-hdmi: add support for multi byte register width access 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=54621F3B.8050103@imgtec.com \
--to=zubair.kakakhel@imgtec.com \
--cc=airlied@linux.ie \
--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=inki.dae@samsung.com \
--cc=jay.xu@rock-chips.com \
--cc=jwboyer@redhat.com \
--cc=l.stach@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=p.zabel@pengutronix.de \
--cc=rmk+kernel@arm.linux.org.uk \
--cc=robh+dt@kernel.org \
--cc=seanpaul@chromium.org \
--cc=shawn.guo@linaro.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