Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp620162pxy; Wed, 28 Apr 2021 10:36:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwV7gFh8WqewGrL3UVOQxD/g+zAAf9Wr1RON8iKJ8PCjEFAuoCSz3tfpWNAGPQNSVL9un5E X-Received: by 2002:a05:6402:5203:: with SMTP id s3mr12817860edd.360.1619631409311; Wed, 28 Apr 2021 10:36:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619631409; cv=none; d=google.com; s=arc-20160816; b=DKADIBTx7Fq7pFNQP61fw7KRdC//oatGlA37j5l2f+3Izz08zsLtovTS+qmfxqgxJ2 lQKHj5dPvm2WxPY3x5QtVuGqix2z7E11pJIaEmYeo2fu0TlBcm0R/qbmn8CD1s73DX6u G+rY4jpddMdByT4snhMaUi+W+1pOhcpho6YBas4Z34zWGJ3J+dRNEOj5T10uNfeQiT9p zib7Llc6xiNjm8CHHrjgwTOCBbJSN67Y/xry8+i/wl3fqijADl+Mw4c3vx1ZUmm02AHZ /5RJDnhXAguPxlPYS6MSHM26R1JHXbykgx/myAvTeLTHZvaQnvh2vJguW79hW4G9siEr cfsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ZFEhJ4EAuP9YoeDXAP6FyIrsbINyeDS35gLbA/9242U=; b=Y2oRwTGu6ljQMc3Mjrmd/SeMcJtwpK/mbv1sASTwxeHTWfi3dUkK4BnRNSDBLyk3g1 V/QY4JoBvnZwgFBjcJRAXAN3xULG5Wj7jzes/3IVFZTdEYQsgDNI3llA9cHinxty/L9B YNOAzWNPNSQfElFd2DDnUXPH35rclvZ4pldD4qqw5XAWjeALX33LaxfwK3+obHdZ4Hw4 G5uwyNlopqvw9oBNH6sL1goQRazZBfrontrkSYqZKzuymgxmmCPGgvXs7/k7Vto6pMpk sN4QsNb+I3Wq85Z5LDFiYddOCkw6ZerxMRwUBah5CPlSVyNpELVifzNP50AlAEbLEM6n MZJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tSdq8BIs; 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 d4si607991eja.217.2021.04.28.10.36.24; Wed, 28 Apr 2021 10:36:49 -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=tSdq8BIs; 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 S229939AbhD1PEF (ORCPT + 99 others); Wed, 28 Apr 2021 11:04:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231628AbhD1PD5 (ORCPT ); Wed, 28 Apr 2021 11:03:57 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A427C061352; Wed, 28 Apr 2021 08:02:48 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id x5so13143292wrv.13; Wed, 28 Apr 2021 08:02:48 -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=ZFEhJ4EAuP9YoeDXAP6FyIrsbINyeDS35gLbA/9242U=; b=tSdq8BIskex/7GSoqC84F4OD4VVoT6fI6YdkyBQ3XH0MzNciz7zjJMODzK66aEqGLL lFcinPue6YmuUudUfeiG61Y1Oh0aV13SDjpYo6gi9FsaevwPXdmNWmarNv/5MF0F8lP+ cZSZiGrpLJ5RlNHS/lJ1XbkqlddpYQqtrX4Az4ilnAvEoXC06kPpSepC0DV5bvyNmYpN Xk3De+Ni+VacEDV1+ziNXv8MnfRbnTV24cdXW8gcz+WwPxPqbAH0D5YpZVOYwdL/jVUH G7ZcScqxMjQSiSHeAH3f9sdeSX84Le01DquxaKG3IEX6+3EFbLGP648bCFif8ugAEoxb 0oRA== 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=ZFEhJ4EAuP9YoeDXAP6FyIrsbINyeDS35gLbA/9242U=; b=QzG7S2OesftMsXTuGKHNxVqUhZlsLhNoK1po6b+muE/9EQM0hU08Xe3Fg8Hi6htpqV tUNF4Tjvlsvsod82dgeQ2Wq106zxbwJC3z0xTJd/TSbtIyKKUGWQIHyhj6IgNTCA9Rg8 Be3CzlM8eoqLve0kbaArRupWion2LW8pnJSBssq8G5XhEy47G9HzkJ8DtqeGWaUbWlvf rzha+c/yPevd+ZV/txdwjqL652pb61qN0RPfnAq/SG0XXlIU4hLUoBSBNSqyZ2vihteQ 4phOeX7zi8UV67rydeqQDrtHpJSjagv0ULsy9LjoT+qCS9piXrdfLVVato3ZmwI9pk+E 2OsQ== X-Gm-Message-State: AOAM53371aCZvq/hw7Kwbsg7g9aqzvmn2KDJFaqS6c7sFtk2vDa/xmuP zi/gNJFUuDrUVhrv/Vdok33xSb7hgS1mN8wu4eY= X-Received: by 2002:a5d:590b:: with SMTP id v11mr27215074wrd.415.1619622167243; Wed, 28 Apr 2021 08:02:47 -0700 (PDT) MIME-Version: 1.0 References: <20210426095426.118356-1-tsbogend@alpha.franken.de> <6f6bce2f070998db49acca2f6611727b@walle.cc> <880011ffd80ae7d1a32e7a17d405b987@walle.cc> <3a23d7e901ac72630aadbd274517f8ec@walle.cc> In-Reply-To: <3a23d7e901ac72630aadbd274517f8ec@walle.cc> From: Andy Shevchenko Date: Wed, 28 Apr 2021 18:02:29 +0300 Message-ID: Subject: Re: [PATCH v4 1/2] gpio: Add support for IDT 79RC3243x GPIO controller To: Michael Walle Cc: Thomas Bogendoerfer , Linus Walleij , Bartosz Golaszewski , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , Mark Brown Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 28, 2021 at 5:48 PM Michael Walle wrote: > > [Adding Mark here, too] > > Am 2021-04-28 16:32, schrieb Andy Shevchenko: > > On Wed, Apr 28, 2021 at 5:04 PM Michael Walle wrote: > >> Am 2021-04-28 15:44, schrieb Andy Shevchenko: > >> > On Wed, Apr 28, 2021 at 2:57 PM Michael Walle wrote: > >> >> > >> >> Am 2021-04-28 13:07, schrieb Andy Shevchenko: > >> >> > On Wed, Apr 28, 2021 at 1:51 AM Michael Walle wrote: > >> >> >> Am 2021-04-26 12:29, schrieb Andy Shevchenko: > >> >> >> > On Mon, Apr 26, 2021 at 12:55 PM Thomas Bogendoerfer > >> >> >> > wrote: > >> >> >> > > >> >> >> > 2) there is gpio-regmap generic code, that may be worth > >> >> >> > considering. > >> >> >> > >> >> >> This driver uses memory mapped registers. While that is > >> >> >> also possible with gpio-regmap, there is one drawback: > >> >> >> it assumes gpiochip->can_sleep = true for now, see [1]. > >> >> >> Unfortunately, there is no easy way to ask the regmap > >> >> >> if its mmio/fastio. > >> >> > > >> >> > I don't see how it is an impediment. > >> >> > >> >> You'd have to use the *_cansleep() variants with the gpios, > >> >> which cannot be used everywhere, no? > >> > > >> > *can* sleep means that it requires a sleeping context to run, if your > >> > controller is fine with that, there are no worries. OTOH if you want > >> > to run this in an atomic context, then consumers can't do with that > >> > kind of controller. > >> > >> Ok, then we are on the same track. > >> > >> > What I meant above (and you stripped it here) is > >> > to add a patch that will fix that and set it based on > >> > gpio_regmap_config. > >> > >> Yes, but ideally, it would ask the regmap. Otherwise that > >> information is redundant and might mismatch, i.e. gpio_regmap_config > >> tell can_sleep=false but the regmap is an I2C type for example. Also > >> if a driver wants to support both regmap types, we are no step > >> further. > > > > Yeah, I agree that is a band aid, but you are free to fix it actually > > on regmap level. > > I don't think it will require an enormous amount of work there. > > I'd love to fix that, but Mark was against exposing that property > outside of regmap. So it it what it is for now ;) Maybe he'll change > his mind or someone has another idea. Then let's go to ugly variant with duplicating it in gpio-regmap config. with a FIXME note or so. I don't think we should allow new drivers be based on bgpio_init(). -- With Best Regards, Andy Shevchenko