Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp645479ybt; Wed, 24 Jun 2020 07:53:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzluf/tXCiHfuEM5WluH94nwxzhUa6+wrkVu3HMFvKt5tDszeNbOfRIMMUDkx27qKxW+C/N X-Received: by 2002:a17:906:4009:: with SMTP id v9mr24541176ejj.481.1593010433541; Wed, 24 Jun 2020 07:53:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593010433; cv=none; d=google.com; s=arc-20160816; b=N/bDQ0GbDEOfCWzb5fZxKLAD/3dPglb5EmIUmNt2yAq6SSHndOwfOMb79VL+wg2Jqb QTVMavXdX2md5fe4dU2pl+erYk6fApiAzn0Fj8djVjv7KhqsbsZt5EcDmAzgJixIL84/ Jn4HvYlYkzy0wXyhCnt5wLy4mbjJ9v1s+MmyDoZvYYTEaPmXlqnoDLHqPy7SaFDl9Pql r81ylK2T3zk1Co1JTqfl2L2ivp/475czYnPkPneAYeabM9ziVC343v6Uv+KwBiwMJ5L0 3Yq8tdQstddlgDxggpQ8gP2/XV7/3ZKsSYUws034+0QTo8OVGSEm4Zjv/eker7Wfcpmp y27g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=2F6v8JQ44zNL7WDKYUMFQlmy+yKvwRWWXRmkHnYvxmA=; b=qZn7e/f+vM9pM8cuHFI2dEwbNgr77ZJprjIomSAZ74HPIAKQdVLfq2XrRHhFHg0Kkb cIyuim/6tETH4vFK+uIDrN//rKo7NYQ/rmL2dkZBLDGftYHGvglgOqsndF3AAAdblsaq PCrvFK8AHTXExLTDEqNxFmzb3OSD/NbiaC7j6ayxnHLhOVC2e0cshEvcfWpDPaCLUVVx S1A76KTh2NSQXwOczJajrvYyCRNSON3IcoK2VpD5BMpbvhQ4TcmDE4kz7FMJTRCEvfqR pYhMN+7DYGQG2Sfo+x67bSkLKQjh6wO8wb7nKawMFblZHfmbwIhE5NYh4LowE4mOzx16 YC4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gRUizZgU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rs25si7416927ejb.536.2020.06.24.07.53.29; Wed, 24 Jun 2020 07:53:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gRUizZgU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403931AbgFXOwe (ORCPT + 99 others); Wed, 24 Jun 2020 10:52:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390843AbgFXOwb (ORCPT ); Wed, 24 Jun 2020 10:52:31 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B96FBC061573; Wed, 24 Jun 2020 07:52:31 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id x8so250729plm.10; Wed, 24 Jun 2020 07:52:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2F6v8JQ44zNL7WDKYUMFQlmy+yKvwRWWXRmkHnYvxmA=; b=gRUizZgUZKJgrY28tFVUUKrshLf1ohUdM2a/kBaeYieCFRiCLgbbjU1ge2bruKIutR V6Vq/gbn23RrhxS8uz0RdLNdxKXJgKxUb/P2jzTyzkPeEiZEqtive/TQmvdY7db82F2z nkyztsrdb/4ABnUdqEbzt4uD6KAHLG12Atc+VlkG9JQNk8j+4+QUCnisiEyCLq3v77Vr MU+57Ipex43nlk65fQFgmUj4Y9jiN7M9/VlO8KgcrB0not2N7yk4NdfhV5hZNzqIVu8N Zujc1IZGoRexNUX7mD7+mDwoqfzlfgAu+dBu6KjE5CuxPDIP9mX3WT6ybTXsqe/q7U/A BE6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2F6v8JQ44zNL7WDKYUMFQlmy+yKvwRWWXRmkHnYvxmA=; b=LTNDBslrdxPYAb/R/vA6RFE8bkLZaX2DZ/bY+NlNb2+Tf2ERWmZ78TzeR87JqdEKd7 pUgSEIMMVeC2Bl90fQqIfWphgYDIYaO+aVsyoWnvKBmza17OaYKQngaD0fZFeUKImFbu qj1/StkfU9X8GgRSH4fVusuUB8OCzo/Hq/3fhkBC78+8Ev2rzVAIjWVpvnOq/lhf/Uk4 i5CuNC+tPb/fBxn4DRNDbOlEOQ32CPL6J76nL2iCj2q0Wwh/EU+Zjwtvt6bM66gFrytx Log2+fjA2ieZxZpDVUe5HQCnS2JR90b2LKe/SNiWLLRFWr9DK1UcYMUYen7SQtEfpojX xiXA== X-Gm-Message-State: AOAM532gDvML1rv20wgJuL+pHLO0DQ/Zig5yfPhxjFHjnLSdStM3NTVG sQDHImp6xQpQgCC0MCh7c3Pze11Z2ZwjZyQj234= X-Received: by 2002:a17:90a:b30d:: with SMTP id d13mr28499822pjr.181.1593010351239; Wed, 24 Jun 2020 07:52:31 -0700 (PDT) MIME-Version: 1.0 References: <20200623060526.29922-1-mans0n@gorani.run> <80bbca9a625b2a0feb9b816906549b7c@walle.cc> <2291c01d-30df-518e-a952-644bd955f1f3@gorani.run> <69f5d1a1970838b8c4bd8d6e8dba6cac@walle.cc> <9956439a3c887dde7b2b8fa48de20db2@walle.cc> In-Reply-To: <9956439a3c887dde7b2b8fa48de20db2@walle.cc> From: Andy Shevchenko Date: Wed, 24 Jun 2020 17:52:18 +0300 Message-ID: Subject: Re: [PATCH] gpio: add GPO driver for PCA9570 To: Michael Walle Cc: Sungbo Eo , Linus Walleij , Bartosz Golaszewski , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 24, 2020 at 4:46 PM Michael Walle wrote: > Am 2020-06-24 15:33, schrieb Andy Shevchenko: > > On Tue, Jun 23, 2020 at 3:48 PM Michael Walle wrote: > >> Am 2020-06-23 14:22, schrieb Sungbo Eo: > >> > On 2020-06-23 17:31, Michael Walle wrote: > >> >> Am 2020-06-23 08:05, schrieb Sungbo Eo: ... > >> That won't work because the underlying regmap expects the address bits > >> to be either 8 or 16. In this case I'd guess gpio-regmap, doesn't make > >> sense, because there is actually no real gain. > > > > From the DS: > > "The device acknowledges and the master sends the data byte for P7 to > > P0 and is acknowledged by the device. Writes to P7 to P4 are ignored > > in the PCA9570 as only P3 through P0 are available. The 4-bit data is > > presented on the port lines after it has been acknowledged by the > > device. The number of data bytes that can be sent successively is not > > limited. The previous data is overwritten every time a data byte has > > been sent." > > > > So, basically writing to the register the value of register can > > simulate register map, but the question is do we gain anything from > > that abstraction because it means that all 256 (or 16 for 4-bit > > variant) registers are possible? > > Mh? I can't follow you. Port means a physical I/O port, if I > read the datasheet correctly. And because that is a 4 port IO > expander only the lower four bits are used. I'd guess if it is > a 8 port IO expander all bits would be used. (Actually, its > output only.) > > So you just write one byte of data (or you might repeat it, but > that is just as if you start a new i2c transaction, just that > you save the i2c addressing). You can write the same value twice. It means that the first byte can represent the register address. But it's still too volatile. Perhaps regmap can gain something like register-less communication. -- With Best Regards, Andy Shevchenko