From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH 2/2] vga_switcheroo: Add the support for audio clients Date: Thu, 10 May 2012 20:42:26 +0200 Message-ID: References: <20120510122005.4d98d8cf@pyramind.ukuu.org.uk> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTP id 496AA9E732 for ; Thu, 10 May 2012 11:42:27 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: David Airlie Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org At Thu, 10 May 2012 13:42:09 +0200, Takashi Iwai wrote: > > At Thu, 10 May 2012 12:20:05 +0100, > Alan Cox wrote: > > > > On Thu, 10 May 2012 09:10:16 +0200 > > Takashi Iwai wrote: > > > > > Add the support for audio clients to VGA-switcheroo for handling the > > > HDMI audio controller together with VGA switching. The id of the > > > audio controller should be given explicity at registration time unlike > > > the video controller. > > > > It would I think be a lot cleaner and more future proof to pass a > > > > struct hdmi_audio_switch_ops > > > > or some similar named object with an array of function pointers ? > > That would be a good option, indeed. > > In my patch series, I just didn't want to break the existing API, > so I kept the current style. Dave, do you prefer the way with an ops struct as Alan suggested? For example, I can make like struct vga_switcheroo_client_ops { void (*set_gpu_state)(struct pci_dev *dev, enum vga_switcheroo_state), void (*reprobe)(struct pci_dev *dev), bool (*can_switch)(struct pci_dev *dev)); }; and pass the pointer to vga_switcher_register_client() and vga_switcher_register_audio_client(). If it's preferred, I'll work on it and resend you a pull request later. BTW, I modified topic/vga-switcheroo branch of sound git tree again. Now it contains only two commits I posted here. The rest commits for HD-audio are found in topic/hda-switcheroo branch. thanks, Takashi