From patchwork Mon Nov 16 14:28:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 7628081 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D79579F1C2 for ; Mon, 16 Nov 2015 14:44:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 09CE120569 for ; Mon, 16 Nov 2015 14:44:27 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id CBCA820459 for ; Mon, 16 Nov 2015 14:44:25 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 58E7F2605B2; Mon, 16 Nov 2015 15:44:22 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6A04C2604F0; Mon, 16 Nov 2015 15:44:09 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id DB4DF2604DF; Mon, 16 Nov 2015 15:44:07 +0100 (CET) Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by alsa0.perex.cz (Postfix) with ESMTP id 9E344260449 for ; Mon, 16 Nov 2015 15:44:00 +0100 (CET) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.15.0.59/8.15.0.59) with SMTP id tAGEdBBc010521; Mon, 16 Nov 2015 08:43:59 -0600 Received: from mail1.cirrus.com (mail1.cirrus.com [141.131.3.20]) by mx0b-001ae601.pphosted.com with ESMTP id 1y628pjgpy-1; Mon, 16 Nov 2015 08:43:59 -0600 Received: from EX12.ad.cirrus.com (unknown [172.19.9.182]) by mail1.cirrus.com (Postfix) with ESMTP id 02C9E3403A; Mon, 16 Nov 2015 08:44:09 -0600 (CST) Received: from imbe.wolfsonmicro.main (172.20.9.178) by EX12.ad.cirrus.com (172.19.9.182) with Microsoft SMTP Server id 14.3.248.2; Mon, 16 Nov 2015 14:43:57 +0000 Received: from ck-lbox ([172.22.20.70]) by imbe.wolfsonmicro.main (8.14.4/8.14.4) with ESMTP id tAGEhuQf022152; Mon, 16 Nov 2015 14:43:56 GMT Date: Mon, 16 Nov 2015 14:28:13 +0000 From: Charles Keepax To: Pavel Machek Message-ID: <20151116142813.GF18889@ck-lbox> References: <20151113225355.GU12392@sirena.org.uk> <20151114074400.GA7898@amd> <20151114123931.GW12392@sirena.org.uk> <20151114175915.GA20429@amd> <20151114184940.GY12392@sirena.org.uk> <20151114211633.GE20429@amd> <20151115001402.GZ12392@sirena.org.uk> <20151116074534.GA5606@amd> <20151116105035.GA31303@sirena.org.uk> <20151116122947.GA9125@amd> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20151116122947.GA9125@amd> User-Agent: Mutt/1.5.20 (2009-06-14) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1507310000 definitions=main-1511160239 Cc: alsa-devel@alsa-project.org, sameo@linux.intel.com, tiwai@suse.de, linux-kernel@vger.kernel.org, patches@opensource.wolfsonmicro.com, lgirdwood@gmail.com, Mark Brown , lee.jones@linaro.org Subject: Re: [alsa-devel] multi-codec support for arizona-ldo1 was Re: System with multiple arizona (wm5102) codecs X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Nov 16, 2015 at 01:29:47PM +0100, Pavel Machek wrote: > Hi! > > > > > Every single sound driver gets this right, none of them assume the name > > > > is global. What makes you say that they assume names are global? > > > > > Ok, so you are saying that if I fix mfd initialization, sound will > > > automagically switch from global regulators to device-specific > > > regulators and things will start working? > > > > Yes. > > Ok, so something like this should be applied? > > (I'm not sure how to test it, as audio works before and after the > patch.) Well I guess the first test is do these error messages you where getting disappear: > [ 2.734198] wm5102-codec.1 supply MICVDD,spi32766.1 not found, using dummy regulator > [ 3.170912] wm5102-codec.2 supply MICVDD,spi32766.2 not found, using dummy regulator I think what we are missing here is looking at why the lookup is actually failing. I have had a look at the code, but I don't see an obvious reason why having a second CODEC would cause the supply lookup to fail. Can you please apply this diff and provide a log so we can have a look at what is going on with the supply aliasing: Thanks, Charles diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 7181ffd..f1c8897 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1345,9 +1345,11 @@ static struct regulator_supply_alias *regulator_find_supply_alias( { struct regulator_supply_alias *map; - list_for_each_entry(map, ®ulator_supply_alias_list, list) + list_for_each_entry(map, ®ulator_supply_alias_list, list) { + dev_err(dev, "Checking %s,%p\n", map->src_supply, map->src_dev); if (map->src_dev == dev && strcmp(map->src_supply, supply) == 0) return map; + } return NULL; } @@ -1356,11 +1358,12 @@ static void regulator_supply_alias(struct device **dev, const char **supply) { struct regulator_supply_alias *map; + dev_err(*dev, "Looking for %s,%p\n", *supply, *dev); map = regulator_find_supply_alias(*dev, *supply); if (map) { - dev_dbg(*dev, "Mapping supply %s to %s,%s\n", + dev_err(*dev, "Mapping supply %s to %s,%p\n", *supply, map->alias_supply, - dev_name(map->alias_dev)); + map->alias_dev); *dev = map->alias_dev; *supply = map->alias_supply; } @@ -1796,8 +1799,8 @@ int regulator_register_supply_alias(struct device *dev, const char *id, list_add(&map->list, ®ulator_supply_alias_list); - pr_info("Adding alias for supply %s,%s -> %s,%s\n", - id, dev_name(dev), alias_id, dev_name(alias_dev)); + pr_info("Adding alias for supply %s,%p -> %s,%p\n", + id, dev, alias_id, alias_dev); return 0; }