From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966406AbcKOJVO (ORCPT ); Tue, 15 Nov 2016 04:21:14 -0500 Received: from mail-qk0-f177.google.com ([209.85.220.177]:35889 "EHLO mail-qk0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965934AbcKOJVL (ORCPT ); Tue, 15 Nov 2016 04:21:11 -0500 MIME-Version: 1.0 In-Reply-To: <20161111095036.11803-3-wens@csie.org> References: <20161111095036.11803-1-wens@csie.org> <20161111095036.11803-3-wens@csie.org> From: Linus Walleij Date: Tue, 15 Nov 2016 10:21:10 +0100 Message-ID: Subject: Re: [PATCH v3 2/3] pinctrl: sunxi: Add support for fetching pinconf settings from hardware To: Chen-Yu Tsai Cc: Maxime Ripard , "linux-gpio@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , linux-sunxi 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 Fri, Nov 11, 2016 at 10:50 AM, Chen-Yu Tsai wrote: > The sunxi pinctrl driver only caches whatever pinconf setting was last > set on a given pingroup. This is not particularly helpful, nor is it > correct. > > Fix this by actually reading the hardware registers and returning > the correct results or error codes. Also filter out unsupported > pinconf settings. Since this driver has a peculiar setup of 1 pin > per group, we can support both pin and pingroup pinconf setting > read back with the same code. The sunxi_pconf_reg helper and code > structure is inspired by pinctrl-msm. > > With this done we can also claim to support generic pinconf, by > setting .is_generic = true in pinconf_ops. > > Also remove the cached config value. The behavior of this was never > correct, as it only cached 1 setting instead of all of them. Since > we can now read back settings directly from the hardware, it is no > longer required. > > Signed-off-by: Chen-Yu Tsai Patch applied with Maxime's ACK. Yours, Linus Walleij