From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754158AbdBIRPJ (ORCPT ); Thu, 9 Feb 2017 12:15:09 -0500 Received: from outils.crapouillou.net ([89.234.176.41]:33188 "EHLO outils.crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752830AbdBIROk (ORCPT ); Thu, 9 Feb 2017 12:14:40 -0500 To: Linus Walleij Subject: Re: [PATCH v3 04/14] GPIO: Add gpio-ingenic driver MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 09 Feb 2017 18:14:32 +0100 From: Paul Cercueil Cc: Rob Herring , Mark Rutland , Ralf Baechle , Ulf Hansson , Boris Brezillon , Thierry Reding , Bartlomiej Zolnierkiewicz , Maarten ter Huurne , Lars-Peter Clausen , Paul Burton , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Linux MIPS , linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-pwm@vger.kernel.org, linux-fbdev@vger.kernel.org, James Hogan In-Reply-To: References: <27071da2f01d48141e8ac3dfaa13255d@mail.crapouillou.net> <20170125185207.23902-1-paul@crapouillou.net> <20170125185207.23902-5-paul@crapouillou.net> Message-ID: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > What some drivers do when they just get/set a bit in a register > to get/set or set the direction of a GPIO, is to select GPIO_GENERIC > and just bgpio_init() with the right iomem pointers, then the core > will register handlers for get, set, set_direcition callback and > get_direction and your driver can just focus on the remainders. GPIO_GENERIC and bgpio_init() would work for my .set() / .get() callbacks, not for my .direction_input() / .direction_output() callbacks which need to set more than one register. > If you're not just replacing these with GPIO_GENERIC, please also > include a .get_direction() callback. My .direction_input() and .direction_output() callbacks just call into the pinctrl driver, using pinctrl_gpio_direction_[in,out]put(). I didn't find a way to get the direction info from the pinctrl driver, is that something that the core should provide? Thanks, -Paul