Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp12461705imu; Wed, 2 Jan 2019 00:34:12 -0800 (PST) X-Google-Smtp-Source: ALg8bN7DekC5ahghnk7DndfAPMrxkVxvTN3M6EtpaWEPtiWVqXf/L5DrHeNENsSe5HEAp1wN8BIy X-Received: by 2002:a63:d047:: with SMTP id s7mr40585898pgi.311.1546418052676; Wed, 02 Jan 2019 00:34:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546418052; cv=none; d=google.com; s=arc-20160816; b=K+NGMoTTwcyfOjL65/HVwqYDtsrtc/emKuy3TfBLSp+qh42ehWibcAtvCmdpg9BOxh USKm9FxO78rrAsBKaKsi5eNRNxR9w68Sl9iy9HeHcddNlqxf47gvz6sDYGyZ/vUoqGtK kknVf7DfwszOCPS582LoIN4e12tlhHaD77eFpnZK0JMUMfznS+CiZd2ViEwRNqKFrUaT /0QZGppJm0dy0HxYdEndDrQidRA0yNPa8WwPSB9QM6s/bXHB2S8qjeKWmXx9jfA4z4gb cDfP41qtvCu6gjoJ7dT4VwEzAukJzgs5eB1ind9Lu9xQRwVs+SPhoNXAQh4Cw9t0miay rXBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ZiUjL8hMbXhRpfCriQOI2mRYBvtGHvdgTeT8LQkhk18=; b=ylm4RJpx5rdqzGU/VB/u2IG5+S4zp9qvggwcR0GOgboCqbm9RYul8Pm9gjxkIvJagQ CCBgGXoTJCOVZ+Lc89lcZsVc9wzqFAmlklDfok/HjQ5ac/HxYvNkzDSmsrSbQli16Ghb c5S0hhM2LBbcf6oHyqWx7PCsP2RIvtwQGwU872/leKn9TO1VlmtQ927vdDjwPwYLDW78 D2bwXvfVYixwLiWJzvIxfAyoFHIL074n1B5vv/D4zdW2nD+jMEpKpBmVHx5NZpT0I6iL bOeOV8JXl3Z7K5jqiqgmOm7xo78Rkqa/Vtai1NUHzgfPf5YjCe14rJ8612Yyg5hooEr5 /Z1g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d11si48676341pla.335.2019.01.02.00.33.54; Wed, 02 Jan 2019 00:34:12 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728947AbfABHnD (ORCPT + 99 others); Wed, 2 Jan 2019 02:43:03 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:46541 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727535AbfABHnC (ORCPT ); Wed, 2 Jan 2019 02:43:02 -0500 Received: by mail-lj1-f193.google.com with SMTP id v15-v6so26305289ljh.13; Tue, 01 Jan 2019 23:43:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ZiUjL8hMbXhRpfCriQOI2mRYBvtGHvdgTeT8LQkhk18=; b=QCOA9uVmsXMQokVK9HybjlQMjFdSLAcCi7Tx0nc1thtLoqUFDds6zy/h9FpWX1Fa/a Xxn4vMax3WuMdd2EbyVSMx8DV4IXLObrHyRZmP4hHp/ry9OA74XQfo+Z28x8Krjj4GnN gutoYoJqwb9z7tGPPeif1r6diLp4NrA+0bwQgYkLGoq7gkBK/DNTjHenw+hJzmpPqJdn 3zFnZLcehd5AkDbpaPsFGCF2wbjV+YLV0lvuv91QmyMHnKs3bHz1kdLEoLTAtiREqlOr ml3LTRyLTFHqFk+15MuJMwmG4uBambgioQUqQCJwFwM/SmPj/Xh57FlA0RFXAWlzNgps xmRQ== X-Gm-Message-State: AJcUukeFEN054VCJhK8bKWSZ1+X6bXbluRMK41mDoPbx0x2ptrgVhnbA 9S0CjQu4NbxL7wfmdaTwxfg= X-Received: by 2002:a2e:8643:: with SMTP id i3-v6mr20398868ljj.43.1546414979573; Tue, 01 Jan 2019 23:42:59 -0800 (PST) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id c2-v6sm11077428ljj.41.2019.01.01.23.42.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 01 Jan 2019 23:42:59 -0800 (PST) Date: Wed, 2 Jan 2019 09:42:51 +0200 From: Matti Vaittinen To: Mark Brown Cc: Geert Uytterhoeven , mazziesaccount@gmail.com, heikki.haikola@fi.rohmeurope.com, mikko.mutanen@fi.rohmeurope.com, Greg KH , "Rafael J. Wysocki" , Linus Walleij , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , Vladimir Zapolskiy , Linux-Renesas Subject: Re: [PATCH v3] regmap: regmap-irq/gpio-max77620: add level-irq support Message-ID: <20190102074251.GA8865@localhost.localdomain> References: <20181218115931.GA21253@localhost.localdomain> <20181227073531.GA2461@localhost.localdomain> <20181227075648.GB2461@localhost.localdomain> <20181228080533.GC2461@localhost.localdomain> <20181231191127.GL1846@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181231191127.GL1846@sirena.org.uk> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 31, 2018 at 07:11:27PM +0000, Mark Brown wrote: > On Fri, Dec 28, 2018 at 10:05:33AM +0200, Matti Vaittinen wrote: > > > Last night - just when I was about to get some sleep - it stroke me. I > > think the correct thing to do would be leaving the irq_set_type to NULL > > for those IRQ chips which do not support type setting. If we do that, > > then the irq core will take care of situations where user requests type > > setting but the chip does not support it. Which means the regmap-irq > > would be no different from any other irq chip where type setting is not > > supported. > > Yes, this is the best fix - let the framework handle things properly. > We'll need a second set of operations and to select which to use based > on having type information but that's fine. > > > So at the cost of removing "const" from regmap_irq_chip we could do: > > ... > > > Mark, Geert, what do you think? (And maybe same for the .irq_set_wake - > > but I did omit this as I have never looked at the wake functionality > > before). > > We need a separate struct as otherwise if there's multiple devices with > regmap irq_chip implementations then they'll collide with each other Right. I must admit I didn't notice this! I was about to make a nasty error there... > otherwise I like this approach (or we could copy the irq_chip struct > when registering and then modify which is going to scale a bit better - I am really not a fan of dynamic allocation - I'd rather had static structs with different set of operations. But I admit I can't think of a sane system where we would have more than few regmap_irq controllers so memory consumption of allocating new structs is hardly an issue here. > you're probably right that we need to do the same thing for the wake > configuration. I'll still look at applying your patch as a temporary > fix though. Thanks Mark. I try to cook a patch with copying of struct irq_chip still at this week but I wont rush it (I have some other topics under work) as the regression should be fixed by the other patch. Br, Matti Vaittinen -- Matti Vaittinen ROHM Semiconductors ~~~ "I don't think so," said Rene Descartes. Just then, he vanished ~~~