From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752370AbbCYIol (ORCPT ); Wed, 25 Mar 2015 04:44:41 -0400 Received: from mail-oi0-f41.google.com ([209.85.218.41]:36443 "EHLO mail-oi0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751029AbbCYIof (ORCPT ); Wed, 25 Mar 2015 04:44:35 -0400 MIME-Version: 1.0 In-Reply-To: <20150324150630.GP1878@lahna.fi.intel.com> References: <1427118025-4380-1-git-send-email-robert.dolca@intel.com> <551155C3.2030403@metafoo.de> <551168F0.1090901@metafoo.de> <20150324150630.GP1878@lahna.fi.intel.com> Date: Wed, 25 Mar 2015 09:44:34 +0100 Message-ID: Subject: Re: [PATCH] IIO: Adds ACPI support for ST gyroscopes From: Linus Walleij To: Mika Westerberg Cc: Lars-Peter Clausen , Robert Dolca , Robert Dolca , "linux-iio@vger.kernel.org" , Jonathan Cameron , "linux-kernel@vger.kernel.org" , Hartmut Knaack , Peter Meerwald , Denis CIOCCA Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 24, 2015 at 4:06 PM, Mika Westerberg wrote: > This has few problems that I have not yet figured out. Maybe someone > here can suggest what to do: > > 1) Who is responsible in releasing the GPIO? > 2) What if the driver wants to use that pin as a GPIO instead? The GPIO > is already requested by the I2C core. In the DT usecase we actually specify that in the DTS file so we don't have the problem. Either the consumer accesses the irqchip API with: interrupts = ; or it accesses the GPIO API with: gpios = ; so in that sense it is clear what is requested. Then the core of course uses gpiochip_lock/unlock_as_irq() to handle the case where bugs make a collision (like if both were specified and both APIs tries to access the same resource). But as long as the DTS file is consistent there is no problem. So it seems the ACPI tables are lacking this semantic information? Yours, Linus Walleij