From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946847AbdEZDid (ORCPT ); Thu, 25 May 2017 23:38:33 -0400 Received: from lucky1.263xmail.com ([211.157.147.131]:34082 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032816AbdEZDi0 (ORCPT ); Thu, 25 May 2017 23:38:26 -0400 X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-RL-SENDER: david.wu@rock-chips.com X-FST-TO: linux-kernel@vger.kernel.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: david.wu@rock-chips.com X-UNIQUE-TAG: <329fbda8547b84b8c10b91f30c227fee> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Subject: Re: [PATCH 2/4] pinctrl: rockchip: Add iomux-route switching support for rk3228 To: Heiko Stuebner Cc: linus.walleij@linaro.org, huangtao@rock-chips.com, dianders@chromium.org, linux-rockchip@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org References: <1495717952-9762-1-git-send-email-david.wu@rock-chips.com> <1495717952-9762-3-git-send-email-david.wu@rock-chips.com> <3063930.sJt1b8WyHP@phil> From: "David.Wu" Message-ID: Date: Fri, 26 May 2017 11:38:57 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <3063930.sJt1b8WyHP@phil> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Heiko, 在 2017/5/26 5:12, Heiko Stuebner 写道: > Requiring developers to calculate this pin-bit-value for each bank > is cumbersome and error-prone. With the routes-struct known in > the driver (see above and below), you can keep the the value element > in rockchip_pin_bank, but calculate the per-bank value dynamically > when the bank gets created. > > For example in rockchip_pinctrl_get_soc_data just parse the route-struct > and calculate that value when the driver probes. > > This reduces possible errors and also spares us the clutter of all the > additional PIN_BANK_* defines. It is good to calculate the per-bank value dynamically, Thanks.☺