Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2437857rwi; Fri, 21 Oct 2022 04:00:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM62Hw6jJ6naF6uskHP0nBqD6V3qxubiFyL/6HCBlmrxP/DLlvR3ak5YxYbIcioy9658rXaG X-Received: by 2002:a17:90a:ca96:b0:20b:6ff:1b2 with SMTP id y22-20020a17090aca9600b0020b06ff01b2mr21611726pjt.228.1666350025262; Fri, 21 Oct 2022 04:00:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666350025; cv=none; d=google.com; s=arc-20160816; b=m/aFFptzkP/5pb7PqXZ/+IoevwtrXn1RotaADWfBoVRSMGBV3zgRMEw1OjwJj3SlWX P7TISbtgbRXNowG9bTBj+x+/GO4wZGAwib5df4oDgMB4AVtzm5M/kQyYuGcPvzwwT4vb dhAu+F2jFw0JhRBGVyuv3Xbs2U/QNOBm+WMJlaz1goAzGJUrs+Acr9j/1+LBN3r/u+JS 1/oZhKFKbbw7+vmH9ZhyUycl+QEx1UUt69skHT7rTOR5gZdNPVG5nF08c1B6W/cM0kjg gxSYsOF6oKVKei0rmfVXrYg0+au8d2T+tx0u6Ee/CjDyS2otN1khTrOPDLO6pqiVGGbU HzZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=rmstPx+buejPmH8roPiaphr9U8FnWy49DrYSma5ztJo=; b=w6Qmgqdb4unvUSHYpIniexOCBxXhr5sQ2awHMDJ2Jh4vtgT+/lfdFKqKThPgpqPPLZ PI6N2HK8zFMp5UOCciOeCENkMzGsG+HQGBm5X9gu6C1BSIGfzkEjClq0MecPBeL3KJM9 3NLVdtwxLuBus9xofaDqSj4Fy/SkF6dMpxA+bKoa5C0M9F+ZQvRVT2BZhb1GJxMfE/IT Zu5frf1OE8n5L9aWj3AS6bSnBTT8MT73raCexSJPrTCucBWXe1gEciwO0acun71R3HyF B4ppU6N5f3NeXy2UlAaadAmKbjC6SZght1OaRng4Zui/uZy3q8ifHFW4brwRZRU6HhI4 HXTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FA3jJmYG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v13-20020a17090a458d00b001fe280041e8si5984602pjg.37.2022.10.21.04.00.13; Fri, 21 Oct 2022 04:00:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FA3jJmYG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229817AbiJUKzX (ORCPT + 99 others); Fri, 21 Oct 2022 06:55:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229565AbiJUKzV (ORCPT ); Fri, 21 Oct 2022 06:55:21 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD871244720; Fri, 21 Oct 2022 03:55:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666349719; x=1697885719; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Wx25grSXDV+rY/7gahOrHKDqSL40ohUGsgRb8cn4kGo=; b=FA3jJmYGd7OSRR9QO/OGxVrgA96MPMSCK29YBCWrfuHCokFYV9Lah4tz GYwHYSNctFH79Sk/Vp9APBU6MTyPRtML9lADqQn3DmHpBuIRGYj0ObnSR DYR+OxAjBXhcfJwgnw+67LTuWO+H1nPSJXCOMi0u2SzvP1/IKEUV4cMzA b05qQhRSzi1GlF+18QdTeWNnxp4ZyfesTKwhZyRicV/UGv4+C695aXwnl QE/Ykcn7wp9Qp61rJdYXwIGkp/TLg5IuTkm74GVahtrgpwzqGg7AHAssN wZv498OC7IX1PiEQJCnLXcf6WAJQvtKqdA5RL/NMr7Z0+9rGtdvCJ/iLb w==; X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="305709345" X-IronPort-AV: E=Sophos;i="5.95,200,1661842800"; d="scan'208";a="305709345" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2022 03:55:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="630432859" X-IronPort-AV: E=Sophos;i="5.95,200,1661842800"; d="scan'208";a="630432859" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga002.jf.intel.com with ESMTP; 21 Oct 2022 03:55:14 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1olpgG-00B70q-2S; Fri, 21 Oct 2022 13:55:12 +0300 Date: Fri, 21 Oct 2022 13:55:12 +0300 From: Andy Shevchenko To: Linus Walleij Cc: chengwei , lee@kernel.org, broonie@kernel.org, rafael@kernel.org, mika.westerberg@linux.intel.com, brgl@bgdev.pl, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-gpio@vger.kernel.org, GaryWang@aaeon.com.tw, musa.lin@yunjingtech.com, jack.chang@yunjingtech.com, chengwei , Javier Arteaga , Nicola Lunghi Subject: Re: [PATCH 5/5] pinctrl: Add support pin control for UP board CPLD/FPGA Message-ID: References: <20221019022450.16851-1-larry.lai@yunjingtech.com> <20221019022450.16851-6-larry.lai@yunjingtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 21, 2022 at 11:09:27AM +0200, Linus Walleij wrote: > On Wed, Oct 19, 2022 at 4:26 AM chengwei wrote: > > The UP Squared board implements certain > > features (pin control) through an on-board FPGA. > I am a bit confused by this driver. Andy pointed out some obvious nits that > need to be fixed but the overall architecture here is also a bit puzzling. > > This seems to want to be compatible to Raspberry Pi (RPi), then which one? > > The driver seems to translate GPIO calls to "native GPIO" in some cases, > which GPIO controller is that? There is an SoC level GPIO (Apollo Lake I believe) and there is a discrete component between it and user visible header (connector). This driver AFAIU is about controlling that discrete component. > Also I don't see why, normally a pin control > driver is an agnostic back-end for a GPIO controller, so the GPIO driver > should be the same (whatever "native") means, and this driver should > not even implement a gpio chip, just let the GPIO driver do its job > and call back into the pin control back-end whenever it needs it. > > Also we already have a driver that collects existing GPIOs to a new > GPIO chip, the GPIO aggregator: > drivers/gpio/gpio-aggregator.c > > Maybe if you can explain a bit about how this hardware works and why > you have to do indirect calls to another GPIO controller, things will > be easier to understand? -- With Best Regards, Andy Shevchenko