From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?SmFudXN6IFXFvHlja2k=?= Subject: Re: [PATCH] gpio: mxs: implement get_direction callback Date: Mon, 17 Nov 2014 15:45:00 +0100 Message-ID: <546A09EC.8080809@elproma.com.pl> References: <1416004026-9667-1-git-send-email-j.uzycki@elproma.com.pl> <20141114232601.GW27002@pengutronix.de> <5467A980.5090204@elproma.com.pl> <20141116214239.GX27002@pengutronix.de> <54693A51.5080907@elproma.com.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from v032797.home.net.pl ([89.161.177.31]:59647 "HELO v032797.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752394AbaKQOox (ORCPT ); Mon, 17 Nov 2014 09:44:53 -0500 In-Reply-To: Sender: linux-gpio-owner@vger.kernel.org List-Id: linux-gpio@vger.kernel.org To: Richard Genoud Cc: =?UTF-8?B?VXdlIEtsZWluZS1Lw7ZuaWc=?= , Linus Walleij , Alexandre Courbot , fabio.estevam@freescale.com, Greg Kroah-Hartman , "linux-gpio@vger.kernel.org" , "linux-serial@vger.kernel.org" , Fabio Estevam , "linux-arm-kernel@lists.infradead.org" W dniu 2014-11-17 o 10:26, Richard Genoud pisze: > 2014-11-17 0:59 GMT+01:00 Janusz U=C5=BCycki : >> W dniu 2014-11-16 o 22:42, Uwe Kleine-K=C3=B6nig pisze: >> >> Thanks Uwe. I fully agree with you. >> a) was just a starter to your suggestion. My options were too conser= vative - >> I just >> wanted to avoid tests on hardware I don't have. >> I don't understand why gpiod_get_direction() always requires the cal= lback >> and b) would be broken (I'm not so familiar with gpiolib) but I don'= t need >> it now. >> >> So, it looks we can drop the gpio-mxs patch, yes? >> And, I or Richard should submit a patch for >> mctrl_gpio/atmel_serial/mxs-auart >> to introduce the irq helper, yes? > You're welcome to do it ! > At the time the mctrl_helpers were introduced, there was only one use= r > (atmel_serial), so the line between specific code and factorizable > code was not so clear. > But clearly, the more we factorize, the better ! > >> You wrote passing uart_port is enough. Argument "name" for request_i= rq() can >> be >> recovered from dev_name(dev) or dev_driver_string(dev) where dev =3D >> port_uart->dev. > And, honestly, I'm not sure dev_name(dev) is a good name. > Having something like dev_name(dev)_port_id_CTS may be better. > =46or names other than device's or driver's name I would need to alloca= te string. Is it so important? You can simple check the interrupt and=20 corresponding port: cat /proc/interrupts 50: 0 gpio-mxs 21 80072000.serial 80: 0 gpio-mxs 18 8006c000.serial 81: 0 gpio-mxs 19 8006c000.serial 83: 0 gpio-mxs 21 8006c000.serial 84: 0 gpio-mxs 22 8006c000.serial best regards Janusz > Seems ok ! > > Richard. -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" i= n the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: j.uzycki@elproma.com.pl (=?UTF-8?B?SmFudXN6IFXFvHlja2k=?=) Date: Mon, 17 Nov 2014 15:45:00 +0100 Subject: [PATCH] gpio: mxs: implement get_direction callback In-Reply-To: References: <1416004026-9667-1-git-send-email-j.uzycki@elproma.com.pl> <20141114232601.GW27002@pengutronix.de> <5467A980.5090204@elproma.com.pl> <20141116214239.GX27002@pengutronix.de> <54693A51.5080907@elproma.com.pl> Message-ID: <546A09EC.8080809@elproma.com.pl> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org W dniu 2014-11-17 o 10:26, Richard Genoud pisze: > 2014-11-17 0:59 GMT+01:00 Janusz U?ycki : >> W dniu 2014-11-16 o 22:42, Uwe Kleine-K?nig pisze: >> >> Thanks Uwe. I fully agree with you. >> a) was just a starter to your suggestion. My options were too conservative - >> I just >> wanted to avoid tests on hardware I don't have. >> I don't understand why gpiod_get_direction() always requires the callback >> and b) would be broken (I'm not so familiar with gpiolib) but I don't need >> it now. >> >> So, it looks we can drop the gpio-mxs patch, yes? >> And, I or Richard should submit a patch for >> mctrl_gpio/atmel_serial/mxs-auart >> to introduce the irq helper, yes? > You're welcome to do it ! > At the time the mctrl_helpers were introduced, there was only one user > (atmel_serial), so the line between specific code and factorizable > code was not so clear. > But clearly, the more we factorize, the better ! > >> You wrote passing uart_port is enough. Argument "name" for request_irq() can >> be >> recovered from dev_name(dev) or dev_driver_string(dev) where dev = >> port_uart->dev. > And, honestly, I'm not sure dev_name(dev) is a good name. > Having something like dev_name(dev)_port_id_CTS may be better. > For names other than device's or driver's name I would need to allocate string. Is it so important? You can simple check the interrupt and corresponding port: cat /proc/interrupts 50: 0 gpio-mxs 21 80072000.serial 80: 0 gpio-mxs 18 8006c000.serial 81: 0 gpio-mxs 19 8006c000.serial 83: 0 gpio-mxs 21 8006c000.serial 84: 0 gpio-mxs 22 8006c000.serial best regards Janusz > Seems ok ! > > Richard.