Received: by 10.192.165.156 with SMTP id m28csp746570imm; Thu, 19 Apr 2018 06:58:26 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/EAP8qw0cJoSDX9ImRqeV2atGV3ggrNXozQDnhxAk/Q7uf/Xk4yxCjF4r4qKkMHWXneQlY X-Received: by 2002:a17:902:2468:: with SMTP id m37-v6mr6413042plg.388.1524146306126; Thu, 19 Apr 2018 06:58:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524146306; cv=none; d=google.com; s=arc-20160816; b=LM6Lof8LCMTs/RmGBCXgYczcNN2RGEZSVqI4YEtgWK412Xx+efQtAHhZU7YjEaP80b MWHXYLaOAbu+9s/CZ4So1k6AjVUhynTBORfoybwNgj9fPIJy9h9YesSnOJb5yqGlEtnQ X/y15ywBzqX9XG7ZXrKoC3tbM5JmNXFf0ihKSKf81e40F4ti6ZH9Jf8/xhPmoEoYODXz q6o176qZHgiMqmSuN4N70S+HIZvTYPuJdQzS1AJZyFZLR7i5DAMRjhbtci2NcazxggCO zO3BHdRbvulYDqASGFbhgUEEJ5cqzgj151q2su+Zjs4TRRMY7swAiGzfSnAVuOHEkMf/ 3PCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=ga5u3QCBNFhYBqd8NPGsVqlZbTx3Ie3ydKe8bTAM7jo=; b=c76Hmon0VePu5mdGAbat/GgfsScXNKr7sYzKc4h5wKcQuFxbuZ4QaDwejatQSZiqd8 ooqDQ5jzf+tonNv0uJLaGNAdZx6uM/255QzrS7ZResWaM830UeiN2bS86TxlCbgoTF1l tS73zYPx5cBRuH66YfzxuZ0xJ0aqrIdQqAs7lgXUHgp5bFqcv9H0KiUm7Qtnb6bNjXFw YiKRxh/rQrrfjpmQe6SrYxllTC2V7teM/5KvEPwF44xwGCI0EC1rSyfAUt5NLWnCBD4x 30M+oX/Kx8VAnPXPJiLke8j/JP6dHuSSYjlhJfrX8QjYlJrLjsexC7H6Zx2ANeRP/9oj S1EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=i+ENT5nb; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s3-v6si3568860plb.394.2018.04.19.06.58.12; Thu, 19 Apr 2018 06:58:26 -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=@linaro.org header.s=google header.b=i+ENT5nb; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753223AbeDSNzj (ORCPT + 99 others); Thu, 19 Apr 2018 09:55:39 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:52781 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753114AbeDSNzh (ORCPT ); Thu, 19 Apr 2018 09:55:37 -0400 Received: by mail-it0-f65.google.com with SMTP id f6-v6so7131528ita.2 for ; Thu, 19 Apr 2018 06:55:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ga5u3QCBNFhYBqd8NPGsVqlZbTx3Ie3ydKe8bTAM7jo=; b=i+ENT5nbN5Y+i85Rt+JFzar6SxEo3GAd+aBRHqr1p0o+yFJTvLbv3XO/5i3ccVoSPi JB06Vdk0iAOKAQFZS0XKo/7LW1+w7ovSbSKaRi0124GpUru8QPMyMPLEzyJS3OA1gWID 0KbwZZXH3Qq/UAydbL6BPvUfXMWsvPfkss9bU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ga5u3QCBNFhYBqd8NPGsVqlZbTx3Ie3ydKe8bTAM7jo=; b=BFr44Jam94hhieKVnmCmCRcbk7b197aeb2UaeZ5CUnC7xUoNMfGT2F9M7SzAWXacoH RFCqWfTLOMkk7SyO7oNW3fLaNMEoxw5fQtcMNSG/EHLqLXCJ6hdpP+qDeGF6FXwsL7C1 KSvoPMLeW8JMJlVXwIZKcY5S0Az+IW0uB3y5uO49CYz3s9wiNNwFEGdfqdCk/gJZ89cB a3s42GmSQ0BAA9jSz9yGl9nD2pPOBnvwCEM4AAO5QUqLEWHWoQ8zEHSuyPxgRQfJrbmI GJ5+NH9GLCW4qP7DkIyrZHp5ZOweLAwZKO9QTBFNEI9ogAQwv7Ds7BK80ERoiEpE4zzf esJA== X-Gm-Message-State: ALQs6tDBp1t+5AqKbISm1ey4TPzSoeK1Q8KVpgua2sWLBDfVbEAWvWnZ w2w3J/o2g3qT9C6DAXUl5xqDnoPsq87gD1d8amHtvw== X-Received: by 2002:a24:10c7:: with SMTP id 190-v6mr6522063ity.38.1524146136487; Thu, 19 Apr 2018 06:55:36 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4f:2793:0:0:0:0:0 with HTTP; Thu, 19 Apr 2018 06:55:35 -0700 (PDT) In-Reply-To: <20180213111147.kr4kecqbhmcoq6w2@localhost.localdomain> References: <20180212131717.27193-1-linus.walleij@linaro.org> <20180212131717.27193-17-linus.walleij@linaro.org> <20180213111147.kr4kecqbhmcoq6w2@localhost.localdomain> From: Linus Walleij Date: Thu, 19 Apr 2018 15:55:35 +0200 Message-ID: Subject: Re: [PATCH 16/21] regulator: wm8994: Pass descriptor instead of GPIO number To: Charles Keepax Cc: Liam Girdwood , Mark Brown , "linux-kernel@vger.kernel.org" , "open list:GPIO SUBSYSTEM" , patches@opensource.cirrus.com, Lee Jones Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 13, 2018 at 12:11 PM, Charles Keepax wrote: >> +static struct gpiod_lookup_table wm8994_gpiod_table = { >> + .dev_id = "i2c-wm8958", /* I2C device name */ >> + .table = { >> + GPIO_LOOKUP("GPION", 6, >> + "wlf,ldo1ena", GPIO_ACTIVE_HIGH), >> + GPIO_LOOKUP("GPION", 4, >> + "wlf,ldo2ena", GPIO_ACTIVE_HIGH), >> + { }, >> }, >> }; >> >> @@ -366,6 +379,7 @@ static int wlf_gf_module_probe(struct i2c_client *i2c, >> rev == gf_mods[i].rev)) >> break; >> >> + gpiod_add_lookup_table(&wm8994_gpiod_table); > > Would it be nicer to add this as a new member of gf_mods and > register it inside the loop? There is a lot of stuff that would be nice, but currently I'm almost breaking my back over these refactorings, so I would prefer to take one thing per patch, cleanups can be done later. I am also hesitant to do any unnecessary infrastructure changes as I cannot test anything (don't have this system). > Since eventually we will need tables > for wm5102, wm8994, wm2200, wm8996, wm5100 and wm0010. Just wm5102 and wm8994 this time, because only those drivers pass an enable GPIO to the regulator core. The wm2200 for example is just managing the LDO without the use of the regulator framework (I guess this is technically incorrect). I am only trying to fix the regulators right now, fixing all GPIOs in the kernel tree to use descriptors is something I might have time to accomplish before I retire. > Likewise here the DT bindings for these parts have no -gpio > suffix on them so this will break the DT case. This is solved in the GPIO OF core as mentioned before. I will put a pointer in the commit message. Yours, Linus Walleij