From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8A18C433EF for ; Tue, 9 Nov 2021 22:19:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D5F516108C for ; Tue, 9 Nov 2021 22:19:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343537AbhKIWWV (ORCPT ); Tue, 9 Nov 2021 17:22:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343542AbhKIWVC (ORCPT ); Tue, 9 Nov 2021 17:21:02 -0500 Received: from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABE95C061234 for ; Tue, 9 Nov 2021 14:17:48 -0800 (PST) Received: by mail-ot1-x32f.google.com with SMTP id p11-20020a9d4e0b000000b0055a5741bff7so926533otf.2 for ; Tue, 09 Nov 2021 14:17:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Tm6yQehIZfxegQ8LQXmzpFcIGj8PrEgZNef1SIRm8V4=; b=gW0Q1vghMpdNvpEzqaYw/vBySsb/uRGOLQyXIpWbwKfyLOIK5TbfKgHgOHsomzNzQ1 iqSUqrjeZ94H3uNw+UFDShc83N0fCNS6vZxdNtWsAMMAt48s6BUSzc31oLPZh5ZSz+NI oXhBndndVnFgNqFVoC2Tg0vcycUpR5I5FfGlec0wPa9/ylYz2GwNkIrTESXkqLDnMm7v mDstpsh66kKPpBp4PvtnTkI3ObI1NQmy4Ze1y008VeSMhqa4bu7wd2mCzot6zpNNDP8s JeX0a8SeaBdsRPlcN8Tj+AR44DQiLz/YA6CQggSwGYRajUI36iL/8V4mI9jnGtTxCeeU 3h+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Tm6yQehIZfxegQ8LQXmzpFcIGj8PrEgZNef1SIRm8V4=; b=EKGagH0K6kuZ/I0a7mDx4nn3E5Ljonkb+6SK4oYlvTwa4/8IWY7Iq0UQVAp/AJ842r 4qXQfvT7m1d/PRKeXiQQyXvYbQ8mtZGt4wmpc0nvV9ruMiLoWkPnu9io/5EFzqgpq3aK fhoMfsbu9/Zdjb4rbPTgq6Jikw/Ret8dmfwdWNqSX4PsnLE9JHG8n9qQbvXV22rb6l3e 7ZcVFysIkytBguZEyuNc8IFNFqaX7Fa5HoGRPttIlIcUWpeVz8jJU4T5Vplv2Q3bG4Ah 0E3Nzl/VoygwwiD/6Q34Q6DEmUJbFJeq2RC8kgKEqit0yFcs0hdJynFH9mLQbuMVcCDD 0AkQ== X-Gm-Message-State: AOAM533xXqZZmmiJ2wXftp/XBIjcw5yqTTk5ub7FzmYpsH6wsBMwBb/d oAnhFfu/tf3CZinlNzKhVqsucf41hEfvIdAraCgYeg== X-Google-Smtp-Source: ABdhPJzo4LmUY1pFN2oW/gS3+tIDlYsTBZs9R18Xd1P3754m/dv0m7cnbD7ZvDQF9ZkQEmbRVyX6LHfPFNWuBda049M= X-Received: by 2002:a9d:6348:: with SMTP id y8mr9026567otk.179.1636496268074; Tue, 09 Nov 2021 14:17:48 -0800 (PST) MIME-Version: 1.0 References: <20211109100207.2474024-1-arnd@kernel.org> <20211109100207.2474024-6-arnd@kernel.org> In-Reply-To: From: Linus Walleij Date: Tue, 9 Nov 2021 23:17:34 +0100 Message-ID: Subject: Re: [PATCH v2 5/8] gpiolib: shrink further To: Arnd Bergmann Cc: Andy Shevchenko , "open list:GPIO SUBSYSTEM" , Arnd Bergmann , Bartosz Golaszewski , Geert Uytterhoeven , Linux ARM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Tue, Nov 9, 2021 at 12:18 PM Arnd Bergmann wrote: > Ideally we should only use linux/gpio/consumer.h, which is required for > gpiod_set_debounce(). of_gpio.h is still needed for of_get_named_gpio() > and should be taken out once we change this to gpiod_get(), while > linux/gpio.h is still needed for gpio_is_valid()/gpio_get_value() and should > be removed when those are changed to the gpiod_ versions. > > We could do an intermediate patch that converts one half of the > interface, something like When I convert stuff I try to go all the way when I can. It can be a bit daring if no one is there to test changes. The patch looks good though apart from: > - ts->gpio_pendown = pdata->gpio_pendown; > + ts->gpio_pendown = gpio_to_desc(pdata->gpio_pendown); I usually even go into the defined platform data and try to convert the boardfile to use a descriptor table so this is never needed. (But, more work.) Examples: git log -p --author=Walleij arch/arm/mach-pxa/ > - pdata->gpio_pendown = of_get_named_gpio(dev->of_node, > "pendown-gpio", 0); > + ts->gpio_pendown = gpiod_get(dev, "pendown-gpio", GPIOD_IN); Needs to be just gpiod_get(dev, "pendown", GPIOD_IN); the new API tries the "-gpio[s]" suffixes when going into the device tree. Yours, Linus Walleij From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFF88C433EF for ; Tue, 9 Nov 2021 22:35:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A344760EE5 for ; Tue, 9 Nov 2021 22:35:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A344760EE5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8upC8CxRafYMRd14OatjH3tH3/RDQOQgWy7DlLlgBQY=; b=vSQ/rUkTGihJcM FiphlMTQIR3rxZpsHrT0xjsITbmhY2KzNx+IWXihM8CvMMz26t2NsdwzjEPA3v4jcwX1BV9YRD4VH Lg4+uNe/g3fYVjCJnnmw6YeZrf9NHPQZ6VBJwtUUuOVChMz2GzlO27e1W++hTEoIVYAOBuKdMS2r8 0TDs7DHBCGYbk9wB7jtu3yARFG2NJ5MU0Y/r8Stj4lLB2NYYmsUeGb2FbUn6JjEQSR4+aCIccP4Jw 9Kl/yPTKfDAmA8QQrP9jG28KPRq8AOo+C4ffzvWpQXmge+aXRjLm6DMCV39d5toV3TGiMNINCgHPr vTYLJEliIE1tQSfYQoQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkZgJ-003TvC-OS; Tue, 09 Nov 2021 22:33:32 +0000 Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkZR6-003LbK-Tg for linux-arm-kernel@lists.infradead.org; Tue, 09 Nov 2021 22:17:50 +0000 Received: by mail-ot1-x32c.google.com with SMTP id g91-20020a9d12e4000000b0055ae68cfc3dso871642otg.9 for ; Tue, 09 Nov 2021 14:17:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Tm6yQehIZfxegQ8LQXmzpFcIGj8PrEgZNef1SIRm8V4=; b=gW0Q1vghMpdNvpEzqaYw/vBySsb/uRGOLQyXIpWbwKfyLOIK5TbfKgHgOHsomzNzQ1 iqSUqrjeZ94H3uNw+UFDShc83N0fCNS6vZxdNtWsAMMAt48s6BUSzc31oLPZh5ZSz+NI oXhBndndVnFgNqFVoC2Tg0vcycUpR5I5FfGlec0wPa9/ylYz2GwNkIrTESXkqLDnMm7v mDstpsh66kKPpBp4PvtnTkI3ObI1NQmy4Ze1y008VeSMhqa4bu7wd2mCzot6zpNNDP8s JeX0a8SeaBdsRPlcN8Tj+AR44DQiLz/YA6CQggSwGYRajUI36iL/8V4mI9jnGtTxCeeU 3h+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Tm6yQehIZfxegQ8LQXmzpFcIGj8PrEgZNef1SIRm8V4=; b=qDyPOoxkj4hlNoI+S/pBPBd5n/3lZ3rWvcppP3PjOCWA4/jSnTtVXMQBLwm3JM7/0p +LzFYs/SV/FaViczAgXiF7c8FVUQVXb8JOqe9bHV7ib7SkHYdN2ev3pSFMJ3Ej0C6Du/ e0w9xGduXXUgvlTaTBEX2S1dWQrxdHClAbPq/d+3cseK5mc/gfoIg4rLsh0Ed5Vb8ROo +rrAgoesZHbyuh3YX+HxsGJg7U+NagoiC8kfL7CLIlE95oPQ8xU3lqhFUvHCnNLP8ah9 O7UHz4ixswX+kDqsC+umfUEwKMnZoRpBP4QVeww77HmtfSyfRNT0oL6j1Iz8W3soPwQc HpBA== X-Gm-Message-State: AOAM532y0jmSlRENlvYA/afR86I0k7mHgj2SJHve3ssOmoq6UHcnAzd4 1rIaLhTCjeywLfkMDszlHYyGjezGinQy38mklstzkA== X-Google-Smtp-Source: ABdhPJzo4LmUY1pFN2oW/gS3+tIDlYsTBZs9R18Xd1P3754m/dv0m7cnbD7ZvDQF9ZkQEmbRVyX6LHfPFNWuBda049M= X-Received: by 2002:a9d:6348:: with SMTP id y8mr9026567otk.179.1636496268074; Tue, 09 Nov 2021 14:17:48 -0800 (PST) MIME-Version: 1.0 References: <20211109100207.2474024-1-arnd@kernel.org> <20211109100207.2474024-6-arnd@kernel.org> In-Reply-To: From: Linus Walleij Date: Tue, 9 Nov 2021 23:17:34 +0100 Message-ID: Subject: Re: [PATCH v2 5/8] gpiolib: shrink further To: Arnd Bergmann Cc: Andy Shevchenko , "open list:GPIO SUBSYSTEM" , Arnd Bergmann , Bartosz Golaszewski , Geert Uytterhoeven , Linux ARM , Linux Kernel Mailing List X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211109_141749_087195_22DDFF5D X-CRM114-Status: GOOD ( 19.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Nov 9, 2021 at 12:18 PM Arnd Bergmann wrote: > Ideally we should only use linux/gpio/consumer.h, which is required for > gpiod_set_debounce(). of_gpio.h is still needed for of_get_named_gpio() > and should be taken out once we change this to gpiod_get(), while > linux/gpio.h is still needed for gpio_is_valid()/gpio_get_value() and should > be removed when those are changed to the gpiod_ versions. > > We could do an intermediate patch that converts one half of the > interface, something like When I convert stuff I try to go all the way when I can. It can be a bit daring if no one is there to test changes. The patch looks good though apart from: > - ts->gpio_pendown = pdata->gpio_pendown; > + ts->gpio_pendown = gpio_to_desc(pdata->gpio_pendown); I usually even go into the defined platform data and try to convert the boardfile to use a descriptor table so this is never needed. (But, more work.) Examples: git log -p --author=Walleij arch/arm/mach-pxa/ > - pdata->gpio_pendown = of_get_named_gpio(dev->of_node, > "pendown-gpio", 0); > + ts->gpio_pendown = gpiod_get(dev, "pendown-gpio", GPIOD_IN); Needs to be just gpiod_get(dev, "pendown", GPIOD_IN); the new API tries the "-gpio[s]" suffixes when going into the device tree. Yours, Linus Walleij _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel