All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Henningsson <david.henningsson@canonical.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, vinod.koul@intel.com,
	intel-gfx@lists.freedesktop.org, daniel.vetter@intel.com
Subject: Re: [PATCH 1/4] drm/i915: Add audio hotplug info struct
Date: Wed, 22 Jul 2015 10:50:03 +0200	[thread overview]
Message-ID: <55AF593B.8030609@canonical.com> (raw)
In-Reply-To: <s5hbnf4iou6.wl-tiwai@suse.de>



On 2015-07-22 10:22, Takashi Iwai wrote:
> On Tue, 21 Jul 2015 09:57:24 +0200,
> David Henningsson wrote:
>>
>> This struct will be used to transfer information from the i915
>> driver to the hda driver on HDMI hotplug events.
>>
>> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
>
> Looks good to me, just a few nitpicking:
>
>> ---
>>   include/drm/i915_component.h |   19 +++++++++++++++++++
>>   1 file changed, 19 insertions(+)
>>
>> diff --git a/include/drm/i915_component.h b/include/drm/i915_component.h
>> index c9a8b64..4fc0db3 100644
>> --- a/include/drm/i915_component.h
>> +++ b/include/drm/i915_component.h
>> @@ -24,8 +24,22 @@
>>   #ifndef _I915_COMPONENT_H_
>>   #define _I915_COMPONENT_H_
>>
>> +struct hdac_bus;
>> +
>> +struct i915_audio_hotplug_info {
>> +	int connector_type; /* DRM_MODE_CONNECTOR_*, meant for userspace */
>> +	int connector_type_id; /* Index within a DRM_MODE_CONNECTOR_* type, meant for userspace */
>> +	int port; /* Used for mapping to affected nid */
>> +	int port_multi_stream_device; /* For DP multi-streaming */
>> +
>> +	bool plugged_in;
>> +	uint8_t *eld;
>
> Use u8 or just unsigned char as it's a in-kernel API.
> Also, safer to add const, since this is read-only for audio side.

Ok.

>
>> +	int eld_size;
>> +};
>> +
>>   struct i915_audio_component {
>>   	struct device *dev;
>> +	struct hdac_bus *hdac_bus;
>
> If we want to be more generic, using a struct device would be better,
> e.g.
> 	struct device *audio_dev;

Does this work? If we want to have the hdac_bus.dev ptr instead of a 
hdac_bus ptr, there does not seem to be an obvious way to go from the 
audio_dev back to the hdac_bus struct (as snd_hdac_bus_init takes an 
arbitrary dev pointer).

>>   	const struct i915_audio_component_ops {
>>   		struct module *owner;
>> @@ -34,6 +48,11 @@ struct i915_audio_component {
>>   		void (*codec_wake_override)(struct device *, bool enable);
>>   		int (*get_cdclk_freq)(struct device *);
>>   	} *ops;
>> +
>> +	const struct i915_audio_component_cb_ops {
>> +		struct module *owner;
>
> Do we need the owner field at all?

It was merely for symmetry. I'll remove it for v2.

>> +		void (*hotplug_notify)(struct hdac_bus *, const struct i915_audio_hotplug_info *);
>> +	} *cb_ops;
>
> cb_ops doesn't sound intuitive.  Any better name?

I was thinking of it as "callback ops", i e, calls that go in the 
reverse direction compared to the already existing "ops".

But if we call the device "audio_dev" as you suggested above, then maybe 
"audio_ops" would be nice and symmetric?

-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-07-22  8:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-21  7:57 [PATCH 0/4] i915 to call hda driver on HDMI plug/unplug David Henningsson
2015-07-21  7:57 ` [PATCH 1/4] drm/i915: Add audio hotplug info struct David Henningsson
2015-07-22  8:22   ` Takashi Iwai
2015-07-22  8:50     ` David Henningsson [this message]
2015-07-22  8:55       ` Takashi Iwai
2015-07-22 14:13         ` Vinod Koul
2015-07-22 17:52           ` David Henningsson
2015-07-22 20:31             ` Takashi Iwai
2015-07-23  3:43               ` Vinod Koul
2015-07-23  6:17               ` David Henningsson
2015-07-23  6:25                 ` David Henningsson
2015-07-23 10:02                   ` Takashi Iwai
2015-07-21  7:57 ` [PATCH 2/4] drm/i915: Call audio hotplug notify function David Henningsson
2015-07-21  9:14   ` Daniel Vetter
2015-07-21 14:26     ` David Henningsson
2015-07-21  7:57 ` [PATCH 3/4] ALSA: hda - Dispatch incoming HDMI hotplug i915 callback David Henningsson
2015-07-22  8:30   ` Takashi Iwai
2015-07-22 13:56     ` Vinod Koul
2015-07-22 14:01       ` Takashi Iwai
2015-07-21  7:57 ` [PATCH 4/4] ALSA: hda - Wake the codec up on hotplug notify events David Henningsson
2015-07-21 17:37 ` [PATCH 0/4] i915 to call hda driver on HDMI plug/unplug R, Durgadoss
2015-07-22  8:50   ` Takashi Iwai
2015-07-22 15:53   ` David Henningsson
2015-07-22 15:28 [PATCH v2 " David Henningsson
2015-07-22 15:28 ` [PATCH 1/4] drm/i915: Add audio hotplug info struct David Henningsson

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=55AF593B.8030609@canonical.com \
    --to=david.henningsson@canonical.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=daniel.vetter@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tiwai@suse.de \
    --cc=vinod.koul@intel.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 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.