Path: csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod From: Linus Walleij Newsgroups: linux.kernel Subject: Re: [PATCH 0/4] gpio: pxa: integrate with pincontrol Date: Mon, 14 Dec 2015 14:50:03 +0100 Message-ID: References: X-Original-To: Robert Jarzmik Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=JWBBprCm5GD1lbfdbeH2+Lc/YcyEfqe/SiIxH4CErIw=; b=1QQradjm81LJo6FlM2olsAXGI1a0Ns7vsusvmhwXi3FUIvDS69NHOQEffsXjjfLITn y8Y8Zu4JHrP2rchWbaVwQrIOYa2XFPQDuJFXHnrti3a/KhLUd/L6LAktiEFn8dzGydd6 RgMW+Y+nntCBN45bHbaS3letiaEemohpPC7G3k4fZBoTr/6S2j7+qKOBUutOK5LvhTj9 RcBhL6Sx0b1b6D6J4vsCTrzXAqqdPN2pw6YEJZ8o9/FfPRtdbyMIo1anaU0WkbwB7kxo +p4Ap1fFjYJOkNfaAzjljTgivyyeNTaxNpaX+sOUhPIbckjNdqouZMI0iRpmutziG0A1 mcfA== X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=JWBBprCm5GD1lbfdbeH2+Lc/YcyEfqe/SiIxH4CErIw=; b=JGSuWXxJ7NfoxPx0K5f/DZY44ReQA8xhoVRplYUj1Yi9m0WUNRNJxHxI1rGXLmGmOQ fc3VrWYnHIs1nchswxBRGIc7GSJ0ATa8dlHNVXkekzKtOR0QqSzoNE9TErKixy1cu9YA A05iHETO9qkbCrjVOfjvuYZlVMEMgXhUEASuaGLLnIFx36iL7S0h9aFfd3WLpHdgGn05 5wpucPV8mpm+AjFlCY2m/CNMqbI96nLAy19El26rYJdXy6REWdZGfhe6nxvBwWaw/IX3 bUAl5i5/ykDmBXYAMAaMibs2F5MZg9tDJGf7WDUO5iVjsHvVRlx2MrKYQYRsPs7YSVQz ZPzQ== X-Gm-Message-State: ALoCoQnvoMEYwQ0GQo/OBzuFxiG6dOpJ5RwnrT3QN+ZBYNEnRpaj4YUdKlscNPMdgGEiq57lqdTvdHTSofO882mxK3ZHDlJcfTt1TZh8iKkUyUPspXFFbB0= MIME-Version: 1.0 X-Received: by 10.202.196.67 with SMTP id u64mr2603355oif.94.1450100543796; Mon, 14 Dec 2015 05:42:23 -0800 (PST) Content-Type: text/plain; charset=UTF-8 Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 44 Organization: linux.* mail to news gateway X-Original-Cc: Alexandre Courbot , Haojian Zhuang , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Daniel Mack X-Original-Date: Mon, 14 Dec 2015 14:42:23 +0100 X-Original-Message-ID: X-Original-References: <1448746665-13422-1-git-send-email-robert.jarzmik@free.fr> <87lh92kbjg.fsf@belgarion.home> <87d1uejjmr.fsf@belgarion.home> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1291194 On Thu, Dec 10, 2015 at 6:31 PM, Robert Jarzmik wrote: > Linus Walleij writes: > >>> - the GPDR (gpio direction register) shared access bothers me a bit >> >> How is it shared and between what users? > > It's shared between the pin controller and the gpio controller. OK then it may be one of these cases where we should jit the pin controller and the GPIO controller together in the same file (under drivers/pinctrl) to simplify the mess. We can do that in the NEXT merge window because right now I don't want any more crisscross between gpio and pin control as there are refactorings I'm piling up. Another option is e.g. accessing the registers through regmap-mmio but it feels a bit like overkill for this... > The odd thing with the pxa architecture is that the GPDR bit selects between 2 > different alternate functions, even when the pin is not a GPIO. Strange design, > isn't it ? Probably just unfortunate naming. In my presentation "building GPIO and pin control from the ground up" I try to explain a bit how hardware engineers design these things... http://dflund.se/~triad/papers/pincontrol.pdf > As a consequence, both the gpio driver and pinctrl have to modify it, for > different purposes : > - pinctrl will modify it to select a specific alternate function > - gpio driver will modify it when the pin is a GPIO, to modify its direction. OK. Solutions per above, I guess it currently just optimistically hope we do not fiddle the same bit in parallell from the two drivers (which is maybe even possible to prove to be true). Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/