dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: yakir <ykk@rock-chips.com>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>,
	mmind00@googlemail.com, marcheu@chromium.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	dianders@chromium.org, linux-kernel@vger.kernel.org,
	linux-rockchip@lists.infradead.org,
	dri-devel@lists.freedesktop.org,
	Russell King <rmk+kernel@arm.linux.org.uk>,
	Andy Yan <andy.yan@rock-chips.com>
Subject: Re: [PATCH v4 04/15] drm: bridge/dw_hdmi: add identification registers parse and record
Date: Thu, 12 Mar 2015 22:32:31 +0800	[thread overview]
Message-ID: <5501A37F.10305@rock-chips.com> (raw)
In-Reply-To: <1426156158.14455.24.camel@pengutronix.de>


[-- Attachment #1.1: Type: text/plain, Size: 3400 bytes --]

Hi philipp,

On 2015年03月12日 18:29, Philipp Zabel wrote:
> Am Samstag, den 28.02.2015, 21:35 -0500 schrieb Yakir Yang:
>> By parsing the identification registers we can know what functions
>> are present on the hdmi ip.
>>
>> Signed-off-by: Yakir Yang <ykk@rock-chips.com>
>> ---
>> Changes in v4:
>> -Correct phy_type assignment bug
>>
>> Changes in v3:
>> - Add ID registers parse and record
>>
>> Changes in v2: None
>>
>>   drivers/gpu/drm/bridge/dw_hdmi.c | 59 ++++++++++++++++++++++++++++++++++++++++
>>   drivers/gpu/drm/bridge/dw_hdmi.h | 23 ++++++++++++++++
>>   2 files changed, 82 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/bridge/dw_hdmi.c b/drivers/gpu/drm/bridge/dw_hdmi.c
>> index 08f10da..937beed 100644
>> --- a/drivers/gpu/drm/bridge/dw_hdmi.c
>> +++ b/drivers/gpu/drm/bridge/dw_hdmi.c
>> @@ -79,6 +79,23 @@ static const u16 csc_coeff_rgb_in_eitu709[3][4] = {
>>   	{ 0x6756, 0x78ab, 0x2000, 0x0200 }
>>   };
>>   
>> +struct hdmi_id {
>> +	u8 design;
>> +	u8 revision;
>> +
>> +	bool prepen;
>> +	bool audspdif;
>> +	bool audi2s;
>> +	bool hdmi14;
>> +	bool csc;
>> +	bool hdcp;
>> +	bool hdmi20;
>> +	bool confapb;
>> +	bool ahbauddma;
>> +	bool gpaud;
>> +	u8 phy_type;
>> +};
>>
>>   struct hdmi_vmode {
>>   	bool mdvi;
>>   	bool mhsyncpolarity;
>> @@ -111,6 +128,8 @@ struct dw_hdmi {
>>   	struct clk *isfr_clk;
>>   	struct clk *iahb_clk;
>>   
>> +	struct hdmi_id id;
>> +
>>   	struct hdmi_data_info hdmi_data;
>>   	const struct dw_hdmi_plat_data *plat_data;
>>   
>> @@ -1259,6 +1278,36 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode)
>>   	return 0;
>>   }
>>   
>> +static void hdmi_parse_id(struct dw_hdmi *hdmi)
>> +{
>> +	u8 config0_id, config1_id, config2_id, config3_id;
>> +
>> +	config0_id = hdmi_readb(hdmi, HDMI_CONFIG0_ID);
>> +	config1_id = hdmi_readb(hdmi, HDMI_CONFIG1_ID);
>> +	config2_id = hdmi_readb(hdmi, HDMI_CONFIG2_ID);
>> +	config3_id = hdmi_readb(hdmi, HDMI_CONFIG3_ID);
>> +
>> +	hdmi->id.prepen = config0_id & HDMI_CONFIG0_ID_PREPEN ? true : false;
>> +	hdmi->id.audi2s = config0_id & HDMI_CONFIG0_ID_AUDI2S ? true : false;
>> +	hdmi->id.hdmi14 = config0_id & HDMI_CONFIG0_ID_HDMI14 ? true : false;
>> +	hdmi->id.hdcp = config0_id & HDMI_CONFIG0_ID_HDCP ? true : false;
>> +	hdmi->id.csc = config0_id & HDMI_CONFIG0_ID_CSC ? true : false;
>> +	hdmi->id.audspdif = config0_id & HDMI_CONFIG0_ID_AUDSPDIF ?
>> +			    true : false;
>> +
>> +	hdmi->id.confapb = config1_id & HDMI_CONFIG1_ID_CONFAPB ? true : false;
>> +	hdmi->id.hdmi20 = config1_id & HDMI_CONFIG1_ID_HDMI20 ? true : false;
>> +
>> +	hdmi->id.phy_type = config2_id;
>> +
>> +	hdmi->id.gpaud = config3_id & HDMI_CONFIG3_ID_GPAUD ? true : false;
>> +	hdmi->id.ahbauddma = config3_id & HDMI_CONFIG3_ID_AHBAUDDMA ?
>> +			     true : false;
>> +
>> +	hdmi->id.design = hdmi_readb(hdmi, HDMI_DESIGN_ID);
>> +	hdmi->id.revision = hdmi_readb(hdmi, HDMI_REVISION_ID);
>> +}
> What is the purpose of creating a copy of all the feature bits? As far
> as I can tell you are only ever using hdmi_id.design afterwards.
Yeah, you are right. Seems hdmi audio have long long way to go.
As for now, we just need hdmi_id.design to separate registers.

Agree, I will simplify it in next verison.

>   
>
> regards
> Philipp
regards :)
Yakir
>
>
>


[-- Attachment #1.2: Type: text/html, Size: 4160 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2015-03-12 14:33 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-01  2:10 [PATCH v4 0/15] Those patches is used for dw_hdmi audio support Yakir Yang
2015-03-01  2:18 ` [PATCH v4 01/15] drm: bridge/dw_hdmi: add irq control to suspend/resume Yakir Yang
2015-03-01  2:28 ` [PATCH v4 02/15] drm: bridge/dw_hdmi: wrap irq control in fucntions Yakir Yang
2015-03-12 10:24   ` Philipp Zabel
2015-03-12 14:31     ` yakir
2015-03-12 14:41       ` Philipp Zabel
2015-03-12 14:54         ` yakir
2015-03-01  2:32 ` [PATCH v4 03/15] drm: rockchip/dw_hdmi_rockchip: add resume/suspend support Yakir Yang
2015-03-12 10:24   ` Philipp Zabel
2015-03-12 14:32     ` yakir
2015-03-01  2:35 ` [PATCH v4 04/15] drm: bridge/dw_hdmi: add identification registers parse and record Yakir Yang
2015-03-12 10:29   ` Philipp Zabel
2015-03-12 14:32     ` yakir [this message]
2015-03-01  2:38 ` [PATCH v4 05/15] drm: bridge/dw_hdmi: combine hdmi_set_clock_regenerator_n() and hdmi_regenerate_cts() Yakir Yang
2015-03-01  2:40 ` [PATCH v4 06/15] drm: bridge/dw_hdmi: adjust n/cts setting order Yakir Yang
2015-03-01  2:43 ` [PATCH v4 07/15] drm: bridge/dw_hdmi: set ncts_atomic_write & cts_manual Yakir Yang
2015-03-01  2:45 ` [PATCH v4 08/15] drm: bridge/dw_hdmi: add audio support for more display resolutions Yakir Yang
2015-03-01  2:47 ` [PATCH v4 09/15] drm: bridge/dw_hdmi: enable audio support for No-CEA " Yakir Yang
2015-03-01  2:49 ` [PATCH v4 10/15] drm: bridge/dw_hdmi: add audio sample channel status setting Yakir Yang
2015-03-01  2:52 ` [PATCH v4 11/15] drm: bridge/dw_hdmi: add enable/disable to dw_hdmi_audio callbacks Yakir Yang
2015-03-01  2:57 ` [PATCH v4 12/15] drm: bridge/dw_hdmi: creat dw-hdmi-audio platform device Yakir Yang
2015-03-01  2:59 ` [PATCH v4 13/15] ASoC: codec/dw-hdmi-audio: add codec driver for dw hdmi audio Yakir Yang
2015-03-02  9:15   ` Paul Bolle
2015-03-02 11:31     ` Yakir Yang
     [not found]   ` <1425178760-2655-1-git-send-email-ykk-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2015-03-26 18:11     ` Mark Brown
2015-03-01  3:04 ` [PATCH v4 14/15] ASoC: rockchip/rockchip-hdmi-audio: add sound driver for " Yakir Yang
2015-03-02  9:07   ` Paul Bolle
2015-03-02 11:32     ` Yakir Yang
     [not found]   ` <1425179070-2736-1-git-send-email-ykk-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2015-03-26 18:16     ` Mark Brown
2015-03-27  1:16       ` yakir
     [not found]         ` <5514AF61.2050909-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2015-03-27  1:19           ` Mark Brown

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=5501A37F.10305@rock-chips.com \
    --to=ykk@rock-chips.com \
    --cc=andy.yan@rock-chips.com \
    --cc=dianders@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fabio.estevam@freescale.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=marcheu@chromium.org \
    --cc=mmind00@googlemail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=rmk+kernel@arm.linux.org.uk \
    /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