Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3571927ybt; Tue, 23 Jun 2020 05:49:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9Ymt2c8FF7CYnAoHmDRs5Fpn9M/l2gmWZFx51sa3npraiptuc+PG5Z98OPNgu82JMIi7+ X-Received: by 2002:a17:906:b88c:: with SMTP id hb12mr19406244ejb.483.1592916579185; Tue, 23 Jun 2020 05:49:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592916579; cv=none; d=google.com; s=arc-20160816; b=HcHAM+uCIaZcvy94dW+zqn72xVvNqBjXSS8QupKcisUEsEt8mIrAvi0VPIuLWepI9J CKyC//XMGvIhab3Q5YIESRsluqUz8hOGizcP0H8rGTxu3QSBa0y+r+55mAOXH0tnh5jW J4X0C/C4qWCk9r468iTucrIm1V25/BsNw7M036j5eX+39ZglOWSCtlTbzP2aCaqU2wms 2pYEAxjOL1os7okHbD0CqVsMGcNEYM2QM57XJrpOHqXo4p44Iu2XRAvFe22BDGajMzwt kPunRX03MMY3Qa4Pm7vqPCDJniDYRoWFtb9OfzL4Dw+nyWkoI81QV+ariCgIF/9U20j0 9awQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=uIWcxL06bYKGyY5zeMVQC8JJNVmi1MGHB3ymuX8QDx8=; b=fc969uAngzLrrfozE0nswuvLYhS6pqMq0uVE99559ekqknCQNbO3jFqVFOsJFQxZjT IMuday0o8htUyIYYKqskpiHVNy0mInKDzH8BYIm/8bLGrHKpiGDE5IpOnbEYm42Q9Lvz MpeRpwOpROJVE8+uA13H247exYQMG4Etbv04yITDOEZlpwmXAX/dxiFTtvPc71z1r7zo XyJDTxIISl7Ijb0+i29aX5arVgTVVjX8TZmXbmjG5j1Ddzph3qlWv/TxIDZwFvwbQ90x SpEYTYZv2Pr6No8OctD/u7uSwSUxB+Au7PnG7cvB87Yv7oza+Nwv1P9L2LRrnwCLZRG5 2uWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=vaAvorLb; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dd12si10913207ejb.59.2020.06.23.05.49.16; Tue, 23 Jun 2020 05:49:39 -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=@walle.cc header.s=mail2016061301 header.b=vaAvorLb; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732620AbgFWMrd (ORCPT + 99 others); Tue, 23 Jun 2020 08:47:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729562AbgFWMrc (ORCPT ); Tue, 23 Jun 2020 08:47:32 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B51BFC061573; Tue, 23 Jun 2020 05:47:32 -0700 (PDT) Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id B23A222175; Tue, 23 Jun 2020 14:47:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1592916448; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uIWcxL06bYKGyY5zeMVQC8JJNVmi1MGHB3ymuX8QDx8=; b=vaAvorLb/tf1DLoSyGwy93HCy507E7meWCbgT1aWmcsuteBE6T7phkOdkulKf9JLCxyCUZ kKfr9NZL4CnZZeJ+gsbXYDTDWa+vGCbR659K2P8/1+xUvMAEHj7uEP75IIwVPDvWHsvak+ 0aPcJqUYw4tlLYbUbPIf+3lW2Hv5b94= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 23 Jun 2020 14:47:28 +0200 From: Michael Walle To: Sungbo Eo Cc: Linus Walleij , Bartosz Golaszewski , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Subject: Re: [PATCH] gpio: add GPO driver for PCA9570 In-Reply-To: <2291c01d-30df-518e-a952-644bd955f1f3@gorani.run> References: <20200623060526.29922-1-mans0n@gorani.run> <80bbca9a625b2a0feb9b816906549b7c@walle.cc> <2291c01d-30df-518e-a952-644bd955f1f3@gorani.run> User-Agent: Roundcube Webmail/1.4.5 Message-ID: <69f5d1a1970838b8c4bd8d6e8dba6cac@walle.cc> X-Sender: michael@walle.cc Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sungbo, 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: >>> This patch adds support for the PCA9570 I2C GPO expander. >>> >>> Signed-off-by: Sungbo Eo >>> --- >>> Tested in kernel 5.4 on an ipq40xx platform. >>> >>> This is my first time submitting a whole driver patch, and I'm not >>> really familiar with this PCA expander series. >>> Please let me know how I can improve this patch further. (Do I also >>> need to document the DT compatible string?) >> >> Did you have a look at drivers/gpio/gpio-regmap.c ? Your driver seems >> to be simple enough to be easily integrated with that. If you need a >> blueprint; because at the moment there is no driver in the kernel >> using that, you could have a look at: >> https://lore.kernel.org/linux-gpio/20200604211039.12689-7-michael@walle.cc/ > > Thanks for your advice. I didn't really know what regmap is for... > It seems gpio-regmap is for gpio controllers having val/dir registers. > But pca9570 does not use port registers. The master only sends a data > byte without reg address. Ahh I missed that :( > I'm not sure how to apply gpio-regmap or > regmap-i2c here. > I'll try to investigate if setting reg_size or reg_bits to zero is > possible. > > Please correct me if I'm in the wrong direction. 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. -michael