Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3861415pxj; Mon, 24 May 2021 17:08:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAyJm2zAZoWwOSZ5LphAOJMhGBZVDng3/X6HIBxx0PKbqS3sL3Zi1hY9QPELULcv1IXP1p X-Received: by 2002:a17:906:d285:: with SMTP id ay5mr25689741ejb.418.1621901300683; Mon, 24 May 2021 17:08:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621901300; cv=none; d=google.com; s=arc-20160816; b=CCgGuHaMPXI55OdG7wUvH7kpqlNW/jNQ9AaRTgZD9U5y44081HNHRUBup6q5886g0j kgpzZuRyUYK9OM1MjzBa8FrqQbagZynOOykpx2INczqFTB3l8mKGdr5M9U1S9FnWnmnl trKnpHbx+ZOmOZvmvB4bMTZXVlhlaBl8PHOPS+byHvKSv4LJ5lOJp3G/g8X35OwiVBq4 FlXZHax7Dq8XZDKpuoMWrSFSJKkHn7OeQUbZ7EgxoAyRPw25+fRilI8tIIqH5XuDTN4r eJ4+/BG82R1b9LsM9m7oPhFFLzfrhBQ5DsRx7oq47QMo79Dr3/Cicd4iY6+hbL2tT5Sd rfog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=kMpOljGnfPeM78kPggxibkmCL00Y57PzO5ZmaEV0BXY=; b=X60j5vLUtQmMzKmM6+m0xjzR7vlHRQlq3l6eMMIDRp5Ea7WYymYdkgQVW3xu8gjsdm 1sI4vfwLhofAZy9oXmL+bpNn4sx3FmOYnJIG8V8Tqkxku6nEw3NcsX1006h7EI/L8BP2 r4HpGUSXyIahO5DHcOAArkm1mbyXX9K3jMYxEaTGMxs6LTVmZ0VSGENwFIW5weoy4ZUO 4vLuYflF2TE8yGLhhCCd726inDOOOm1ZOgFonlQf1GVvKBYScvdKdyMjJxgU9D3NuWlp fzWh/2Aw2waxvVvp/tfjFccjJnNLtHSIne/vN95zetWUvMnzgB/sqc7RPfDdev3clc6q WtAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MewdMHu8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id p24si10749832edq.63.2021.05.24.17.07.57; Mon, 24 May 2021 17:08:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MewdMHu8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S229503AbhEYAI1 (ORCPT + 99 others); Mon, 24 May 2021 20:08:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229581AbhEYAIZ (ORCPT ); Mon, 24 May 2021 20:08:25 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FA50C061574 for ; Mon, 24 May 2021 17:06:55 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id j10so43103129lfb.12 for ; Mon, 24 May 2021 17:06:55 -0700 (PDT) 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=kMpOljGnfPeM78kPggxibkmCL00Y57PzO5ZmaEV0BXY=; b=MewdMHu8pSiz9xtZOKCGO2UN+t5TiiRcBHH1a51nLZOQ930DNpl6gJPaV2XGMGRFVM e/50I9+o6cNImkcNqVmAHX1IG1yNlF+DM2eszkohBGYtUWYHCehhn6ipxRJhfR/9wxcu yp+JYSiP05pJjGHOkI4oqCGDNxIX+rKjQWIB2oIlP8QoqW7i9RYKKn76Ir0HgL2Vkyol qZ8LWSZkflFyvnqM1aEJNpem1C1r3uEIL83lAtsZ+Qs1MafIqT6TVc99DPwYyg6+YxgP n9xGP/9mCT8suXOUCn2J9jmJLenG4SLFB9g1rhAIWDXz8kpASz65DzXqXMLjzllemIH9 menQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kMpOljGnfPeM78kPggxibkmCL00Y57PzO5ZmaEV0BXY=; b=D4Df+1BaPDzG3cO6nfssDDKTIMenftZhgO7t3ogzoLTOErUjzYkFjffrBl5qX9IebX omXlaAqYdM5gVT1ei+jO7bKNPo3GGW5lndNCWVDS34el8P61TKFl2rWUYRAxePtCYqAo DOv+O1qmRmyr/OPFST8ScVTiL7FgyH74Zd8gCmZMtWe4Fuo6Zs22/6+EmuwYfcxHFoAL 5ZHPCUiWuQQbMav5YHwdPJyPVQXhUBtYDURXfISvpVoXOYwP0arSN9G/Lt+JEFZvGX8V VWJbVkHmOPjU52joIm9ysCMVZ0+o0eMSNNlmQuC3Y3FMAqxFfWYhS7UH2iWPqdoX6e8J IpoQ== X-Gm-Message-State: AOAM530K28he9yshJ7Bvv+0LTzTlBHyzPID9nvYGs7Aqa3MD5XykBHnk qz1J4fuCLb2vbNl4R/AktHr6Pb9vHRTCbmeGSfp3rA== X-Received: by 2002:a05:6512:1185:: with SMTP id g5mr12286057lfr.586.1621901213604; Mon, 24 May 2021 17:06:53 -0700 (PDT) MIME-Version: 1.0 References: <20210510063602.505829-1-jay.xu@rock-chips.com> <20210510063602.505829-4-jay.xu@rock-chips.com> In-Reply-To: <20210510063602.505829-4-jay.xu@rock-chips.com> From: Linus Walleij Date: Tue, 25 May 2021 02:06:43 +0200 Message-ID: Subject: Re: [PATCH 3/7] gpio: separate gpio driver from pinctrl-rockchip driver To: Jianqun Xu Cc: =?UTF-8?Q?Heiko_St=C3=BCbner?= , Rob Herring , "open list:GPIO SUBSYSTEM" , "open list:ARM/Rockchip SoC..." , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 10, 2021 at 8:36 AM Jianqun Xu wrote: > Separate the gpio driver from the pinctrl driver. > > Signed-off-by: Jianqun Xu Overall this is very good and should be applied. > +#include "../pinctrl/core.h" > +#include "../pinctrl/pinctrl-rockchip.h" Please explain in a comment exactly why you need to include these files. I think it should be the goal to get rid of this dependency. It seems that the driver can be further simplified using GPIO_GENERIC but we can deal with this later, once it is separate. > +static int rockchip_gpio_set_config(struct gpio_chip *gc, unsigned int offset, > + unsigned long config) > +{ > + enum pin_config_param param = pinconf_to_config_param(config); > + > + switch (param) { > + case PIN_CONFIG_INPUT_DEBOUNCE: > + rockchip_gpio_set_debounce(gc, offset, true); (...) > + .set_config = rockchip_gpio_set_config, Can't you just use gpiochip_generic_config() and rely on the pinctrl back-end to deal with this? > + .to_irq = rockchip_gpio_to_irq, Normally this should not be needed with GPIOLIB_IRQCHIP but since you are refactoring an existing driver it is acceptable to keep for now. Yours, Linus Walleij