From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from az33egw02.freescale.net (az33egw02.freescale.net [192.88.158.103]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "az33egw02.freescale.net", Issuer "Thawte Premium Server CA" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 14CDFB7D2E for ; Thu, 29 Apr 2010 03:27:18 +1000 (EST) Received: from de01smr01.freescale.net (de01smr01.freescale.net [10.208.0.31]) by az33egw02.freescale.net (8.14.3/az33egw02) with ESMTP id o3SHREnd019462 for ; Wed, 28 Apr 2010 10:27:15 -0700 (MST) Received: from az33exm25.fsl.freescale.net (az33exm25.am.freescale.net [10.64.32.16]) by de01smr01.freescale.net (8.13.1/8.13.0) with ESMTP id o3SHai9G017494 for ; Wed, 28 Apr 2010 12:36:44 -0500 (CDT) Message-ID: <4BD86FF1.1090507@freescale.com> Date: Wed, 28 Apr 2010 12:27:13 -0500 From: Timur Tabi MIME-Version: 1.0 To: Grant Likely Subject: Re: [alsa-devel] [PATCH 1/2] powerpc: add platform registration for ALSA SoC drivers References: <1272314980-23679-1-git-send-email-timur@freescale.com> <1272350168.24542.6.camel@pasglop> <1272355624.3204.52.camel@odin> <4BD74D0C.40303@freescale.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Cc: alsa-devel@alsa-project.org, kumar.gala@freescale.com, broonie@opensource.wolfsonmicro.com, linuxppc-dev@ozlabs.org, Liam Girdwood List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Grant Likely wrote: > Didn't you just finish saying that you cannot see any situation where > you would want the SSI devices linked into a single audio device? So > then if both SSIs are being used for audio, then do you not need a > machine driver for each ssi? That's right. But in order for my fabric/machine driver to be called at all, I thought I needed to make it a platform driver and use platform_device_register_simple() and platform_driver_register(). >> Are you saying that I should call platform_device_register_simple() >> from the SSI's driver initialization function, fsl_ssi_init()? > > No, I'm saying call it from the probe hook. But then platform_device_register_simple() will be called twice, and it should be called only once. I must be missing something here. > However, you should probably do a two stage platform_device_alloc() / > platform_device_add() so you can add data (node pointer) to the > platform device before it gets probed by the machine driver. Don't you mean platform_device_add_resources() instead of platform_device_add()? That is, use platform_device_add_resources() too add information about each SSI that gets probed, and then after all of the SSIs are probed, then call platform_device_add(). If that's what you mean, then where do I call platform_device_add()? > I'm not talking about platform_data or about the ssi driver decoding > things that the machine driver needs. I'm talking about giving the > machine driver a pointer to the ssi device tree node so you don't need > to go through weird gymnastics to find the correct node again. The only gymnastics I need to go through is this: while ((np = of_find_compatible_node(np, NULL, "fsl,mpc8610-ssi"))) { This finds every SSI node. I then extract the information from the SSI nodes and all the other nodes, and then register it with ASoC. -- Timur Tabi Linux kernel developer at Freescale