Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp603498imu; Thu, 3 Jan 2019 03:56:56 -0800 (PST) X-Google-Smtp-Source: ALg8bN7AVnzF5kMBkystEAEm0DcDCm77tU2MKrMP6iZXlq6iLx5QHpE6AzNLLW0qynxU8amy+xtl X-Received: by 2002:a63:5b48:: with SMTP id l8mr16894083pgm.80.1546516616224; Thu, 03 Jan 2019 03:56:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546516616; cv=none; d=google.com; s=arc-20160816; b=km9paCCtrDz+1qF9mXXHur7YWBbwgj4cx92VNOGN9n68RtYz5r2wd3lRauhfnNAfyE yEEfg/23OPymQo8tzDKighoxzirBHDOjytQpWR2b+jY8wVQQdeWzoy7E9QoP+cTb6gTv XP6OSl9qxmC4+q3pveUjA7MQx5UdZ8egCEpm68XNSiQrQrEFNQmBoPETC5jeIv8cZEfz LvF/EG9w/XOPKTblkNCEp0f2EbY2f2gwMEAmS8QvG9VbF8ipb8IXi4qAP1gb9MsRpKMo FsCBj2PKobyK1WLSQP4RX16HGYPDIIvTXjPLbjHNOL4a+r305ouujlVgfOlZn7gJOW97 taZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=pVY7EXr/cO2WJP2Gjnigw3Nufx+h1I3YQh6Kgr1097Y=; b=eiytPwvQb8DIcn7hGGfUmKjqk3dpLJPl6CpqF1pEXnySPCU+e0SIGMgTQ/UDHTww0w E10WiOLcZpCBI6JN8hjVccnkz7Ltk8WOU+uXkiiY5lbIiRLgnK1KPkZOq2aff2gOcrQf ifb6K2AXN/LwyFCj0KzJn3mZ5k9R5/n7xOJlW0yQQS2Vj7fe6dM561wtnP/OSt+vem6w X7Km7BzU6jVEWQnW5NXvHLQgz1j44h3L3SoVVmlXtbTftghvuV1CDbFYP7HmkYdaS6wv 21OQYD2aABk2LQIomQ6tzPCkAO/k6dujJwcBTx9OgLgijezIiOpO/tqv3GyXa9JOYI9R uJ4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p11si49805295plo.363.2019.01.03.03.56.19; Thu, 03 Jan 2019 03:56:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730336AbfACIvG (ORCPT + 99 others); Thu, 3 Jan 2019 03:51:06 -0500 Received: from mga11.intel.com ([192.55.52.93]:22573 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728617AbfACIvG (ORCPT ); Thu, 3 Jan 2019 03:51:06 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jan 2019 00:51:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,434,1539673200"; d="scan'208";a="103586778" Received: from rfried-ivm1.ger.corp.intel.com (HELO [10.185.130.184]) ([10.185.130.184]) by orsmga007.jf.intel.com with ESMTP; 03 Jan 2019 00:51:03 -0800 Subject: Re: RFC: gpio: mmio: add support for 3 direction regs To: Vladimir Zapolskiy , linus.walleij@linaro.org, bgolaszewski@baylibre.com, linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, vladimir.kondratiev@linux.intel.com References: <32edfd70-95dc-26a1-2ea6-143344cb2384@linux.intel.com> From: "Fried, Ramon" Message-ID: <28205214-d395-1c17-51ee-970300b6a14e@linux.intel.com> Date: Thu, 3 Jan 2019 10:51:02 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/3/2019 10:07, Vladimir Zapolskiy wrote: > Hi Ramon, > > On 01/03/2019 09:36 AM, Fried, Ramon wrote: >> Hi. >> >> I'm working on a driver for STA2X11 GPIO controller who seems to fit >> best to the generic mmio driver, > I hope you have seen the existing driver drivers/gpio/gpio-sta2x11.c I surely did. we have the same IP in our soc but it was changed a lot internally, don't want to litter the original. > >> the only problem I have is with the dir register case. The STA2X11 >> has 3 registers for dir, one for data, one for set and one for >> clear. The generic-mmio driver has support for this fashion for the >> dat & set & clear registers but not for dirout/dirin registers. >> >> I wonder if support for this is generic enough to deserve a patch, if >> so I'm willing to quickly add this support, if not, adding a flag >> such as below, will allow partly using the generic mmio driver only >> for set/get and the direction can be handled outside the driver. >> > If gpio-mmio fits well, then it might be simpler to set a flag > BGPIOF_UNREADABLE_REG_DIR, then call bgpio_init() and then overwrite > .direction_input, .direction_output and .get_direction callbacks, > as a reference you can take a look at gpio-74xx-mmio.c Nice. That's an option I didn't think of, better than setting the flag. what about adding the generic support ? > > -- > Best wishes, > Vladimir