From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean-Christophe PLAGNIOL-VILLARD Subject: Re: dts: question about how to configure PIO used as i2c irq Date: Mon, 15 Oct 2012 07:57:20 +0200 Message-ID: <20121015055720.GQ12801@game.jcrosoft.org> References: <507B7AC3.7090904@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <507B7AC3.7090904-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: "devicetree-discuss" To: Bo Shen Cc: devicetree-discuss , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: devicetree@vger.kernel.org On 10:53 Mon 15 Oct , Bo Shen wrote: > Hi All, > When moving atmel qt1070 linux driver with DT support. The atmel > qt1070 is an I2C device. I meet the following questions. > > The qt1070 DT node > --<-------------- > qt1070: keyboard@1b { > compatible = "atmel,qt1070"; > reg = <0x1b>; > interrupt-parent = <&pioA>; > interrupts = <7 0x0>; > }; > -->-------------- > > DT will parse this node and map irq, the i2c_client->irq. This can > be used directly in atmel qt1070 driver. However, the PIO which used > as irq need configure as a PIO input. Now, we can not use > irq_to_gpio() function to convert irq to gpio. So, if we can not > configure this gpio. > > If we configure the pio in board-dt.c, I think this is not a good > place. For example, if the kernel image support multiplatform, while > on these platform, using different pio for qt1070, so this will > cause only one platform can use qt1070. > > So, for this question, how should I solve it? Would you please > give me some advice? I already reply you in private 4 times you have only 2 choice pass the gpio and manage in c or configure the gpio as input in the xlate or map of the gpio drivers and the mux via pinctrl Best Regards, J.