Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4170509imm; Mon, 18 Jun 2018 10:15:07 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJEaX9fVofE7s5ApwH1mKPae9eh8dQHJsrytIYU9fbQOb5PJd92Mgo51VrXfk73Qsm7J64y X-Received: by 2002:a62:3d05:: with SMTP id k5-v6mr14373635pfa.122.1529342107661; Mon, 18 Jun 2018 10:15:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529342107; cv=none; d=google.com; s=arc-20160816; b=c0+ZBfv3qkrQc9pcmnLTx9gq0ttV42bWrUEwa/m7UfMMY+zsXRFxmGLeqlfkdpAs76 DJ7BhoRaRDppgcGCcmnA67+H9dK0x/wieb4edn/sJ1ruRxMgi0rQwxPNsm14H32qXhPE ac9q64IP5kZRtExKKIMZ5HWlQ54NVlZWn5D4YINZtKyAVCGiPRJdSH+qtDgAmJhCvuTk 7+w1u6WXgg0A+/DNEGnTLjWZ2qEm3UrZA5OUDAYdp+UURAmJLcZwBl2zfwB3jQ4gf4Q3 HxAZ4h0UUXKuelgGHK1P2h5HJFYS+314SLC6CQ09MtgLg1HcxBHa4vURP6eyAD1Gfn2L l0zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=wzPTYkYAdPQGpcD6vjWo+ibAScnLKRUoQCuMSZBqmxg=; b=m6XwBGrpfrcHbFOeeAeI1nixH1RIeDg74UYphOHbw8P9YeZTMs/KQi2ht7Mgg1P3/n stIkQRZdITmVyL4GmpHrV+vPDIn6UXdygyQmA1FIzuh9oEBQ+pHVj97jERqVPqnct4KK SB344iww6m4uIiLnElHo7Zi7cphXZE89BiGMw1baFXVY2wFJ0TCf39meJbf+YFyFh/rD rnn2DhZMo4SwJB0nh6npUfl9A3bAJ/uiHTUSTMOY8p56A/nEtCLEqkTuOF5xXZdnqR/f 3F1CQ7gyY23QNx688BZYqtzHxfK6iyHV0MboMOhivni5VilFPgKecv5f6fu/75fy/t9k wJhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@horus.com header.s=20180324 header.b=DRXvIljL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=horus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q137-v6si16182782pfc.164.2018.06.18.10.14.53; Mon, 18 Jun 2018 10:15:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@horus.com header.s=20180324 header.b=DRXvIljL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=horus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935230AbeFRROO (ORCPT + 99 others); Mon, 18 Jun 2018 13:14:14 -0400 Received: from mail.horus.com ([78.46.148.228]:34897 "EHLO mail.horus.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934857AbeFRRON (ORCPT ); Mon, 18 Jun 2018 13:14:13 -0400 Received: from [192.168.1.20] (193-83-224-126.adsl.highway.telekom.at [193.83.224.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "E-Mail Matthias Reichl", Issuer "HiassofT CA 2014" (verified OK)) by mail.horus.com (Postfix) with ESMTPSA id C7D506409F; Mon, 18 Jun 2018 19:14:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=horus.com; s=20180324; t=1529342051; bh=wzPTYkYAdPQGpcD6vjWo+ibAScnLKRUoQCuMSZBqmxg=; h=Date:From:To:Cc:Subject:From; b=DRXvIljLA4feVNTw1RylzVHWNwIB2bZdXzsB8ezr/iC+oBGa/L1PNLyvLcFHdiY06 MO0L5BtDQYGEpaMTczeAUY5ltN/Jh7ixxApD7LXNtXpbIjze42geMHz1e4jtcr/zEd ON57BrlsrsUSJK8S/piDz1OTYgQDWC3wct2vBIfs= Received: by camel2.lan (Postfix, from userid 1000) id 082E71C78CB; Mon, 18 Jun 2018 19:14:10 +0200 (CEST) Date: Mon, 18 Jun 2018 19:14:10 +0200 From: Matthias Reichl To: Linus Walleij , Liam Girdwood , Mark Brown Cc: patches@opensource.cirrus.com, Richard Fitzgerald , Charles Keepax , linux-kernel@vger.kernel.org Subject: Regression in 4.18-rc1 caused by regulator: arizona-ldo1: Look up a descriptor and pass to the core Message-ID: <20180618171410.z3bshzmwu7x5yylj@camel2.lan> Mail-Followup-To: Matthias Reichl , Linus Walleij , Liam Girdwood , Mark Brown , patches@opensource.cirrus.com, Richard Fitzgerald , Charles Keepax , linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit e1739e86f0cb9c48e8745a610e6981a4e24cadad breaks reading the wlf,ldoena property from device tree. This causes ldo1 to stay off and thus arizona device detection to fail: [ 4.495958] of_get_named_gpiod_flags: parsed 'wlf,reset' property of node '/s oc/spi@7e204000/wm5102@1[0]' - status (0) [ 4.509756] arizona-ldo1 arizona-ldo1: GPIO lookup for consumer wlf,ldoena [ 4.511339] arizona-ldo1 arizona-ldo1: using lookup tables for GPIO lookup [ 4.511351] arizona-ldo1 arizona-ldo1: No GPIO consumer wlf,ldoena found [ 4.511413] LDO1: supplied by RPi-Cirrus 1v8 [ 4.549164] arizona spi0.1: Unknown device ID: 0 With this commit reverted the ldoena GPIO is properly found and asserted high and the arizona device type is read successfully: [ 4.630445] of_get_named_gpiod_flags: parsed 'wlf,reset' property of node '/s oc/spi@7e204000/wm5102@1[0]' - status (0) [ 4.647622] of_get_named_gpiod_flags: parsed 'wlf,ldoena' property of node '/soc/spi@7e204000/wm5102@1[0]' - status (0) [ 4.666100] arizona spi0.1: WM5102 revision C I've tested this on a Raspberry Pi 3 with upstream 4.18-rc1, the Cirrus Logic Audio Card from Element 14 (using a WM5102 connected via SPI) and the downstream card driver added as a module. Both wlf,reset and wlf,ldoena properties are defined in the wm5102 devicetree node: wm5102@1{ compatible = "wlf,wm5102"; reg = <1>; ... wlf,reset = <&gpio 17 0>; wlf,ldoena = <&gpio 22 0>; ... }; If I understand the code correctly the cuplrit seems to be that with this patch the gpio is looked up from the arizona-ldo1 dev, which has a NULL of_node: config.ena_gpiod = devm_gpiod_get_optional(&pdev->dev, "wlf,ldoena", ... The old version did an of lookup in the parent (arizona) dev, which contains the of_node with wlf,ldoena: arizona_ldo1_common_init: struct device *parent_dev = pdev->dev.parent; struct regulator_config config = { }; ... config.dev = parent_dev; ... arizona_ldo1_of_get_pdata(pdata, config, ... arizona_ldo1_of_get_pdata: struct device_node *np = config->dev->of_node; ... pdata->ldoena = of_get_named_gpio(np, "wlf,ldoena", 0); so long, Hias