Received: by 2002:ab2:3b09:0:b0:1ed:14ea:9113 with SMTP id b9csp134238lqc; Thu, 29 Feb 2024 12:29:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXWJ0KpQ3huIWFxo4l/7lwR0VCPN8AqbhgH0CACQS89GKzhO2Q0j2ycGR6HXeZWv4eWUSFlHXBvm3eqxFO9r1bxkYng6KUmWUi0SwvzPA== X-Google-Smtp-Source: AGHT+IH5YnFwJuwIkuE7PxLu5O0VgOYszU7jzgEHOzPuhYvc/z4DDhEgccoJ2MdM17yI7aNU8YLT X-Received: by 2002:a05:6402:22ed:b0:565:833b:639c with SMTP id dn13-20020a05640222ed00b00565833b639cmr28467edb.23.1709238596880; Thu, 29 Feb 2024 12:29:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709238596; cv=pass; d=google.com; s=arc-20160816; b=gpid/in3zwLkfeyRm5s/ZqP49QMFgTmQbmEycAsNl9CDriXpArSr97oAgQDI84R+nW JPKqX68t5/WTJrG5LqpNIJyEBJrJD9OBiYm6VQtI2J6UGOQrXvH2fwqmRNAUdlBEduSh IaUQQszHJC1jsZHWIg8UGml6jTeIlEyk7PsgSDfQ68wBDTFHfGjbZ31X+qBewp2oZHfi j0jd/HokeS5j33OCTZX5QI4GLkzL6HpxhQEWvu68/KpCp1Excwbi5QGoQTXpHRK6NWCN 1+KfuFwSyGohaiR1qVVmOH4pCoCBuCreRLJ+I+u3TgQWjnw8sKM715mW9j4EBLLeroeI N5Lw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Xsz9d2+yFSQZeecH2hOJtT+4TSF8kgLSBhGXKWhoDpQ=; fh=GVQgcdSZd1OEYxPRnJQiKUwCsbIxWo7GyPf0dmjjk7o=; b=dBTGvRE7Lz8hq0ZHnGIKOl35wj3eT/DCCKuoliAb1nM9TPB6R9r6jF3+Nl1YsHSSyE ghxDzsr0LJFzPsjQocWc1AAMqLpuuNQIBH+Z23VhuKrFGx+mSbpWd7fl7SKrm43NN8Qu I4PgKblt/FN7+KXpW1qRwvMH8CdAZzgNA1mM6HrKAG8I9tPBP6PFZCQUKlhxNm9cQM+B sHw9F0n4MztYm2IubvlQDXbLoYxOhfOZZc9ZrM0YRvqrgUWwjIkAx1dmreLTNMWHyFBT RjpfskQSUEkf8k3QjcJPYyRIbsZ8Ks0IVJfqLiKC98km2ifa9JmOSFpUZiypApn8oTqs Q4PQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=OhCzDT6d; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-87423-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87423-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dz20-20020a0564021d5400b00564098c4c23si857491edb.541.2024.02.29.12.29.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 12:29:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87423-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=OhCzDT6d; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-87423-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87423-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 972C81F23D11 for ; Thu, 29 Feb 2024 20:29:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 006C6144024; Thu, 29 Feb 2024 20:29:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="OhCzDT6d" Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B82CF1428E0; Thu, 29 Feb 2024 20:29:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709238576; cv=none; b=uB3Smj8D9aD5oaxwg77wbTEzugZ0ZJPA3yBt2plEFohG0BMi7qlyxIDhFYLM0ZSuxBb7irb5bzWAwTKc/dSg9ieuF+VodbM4Q4d1K1ozF3wNOtYvigesMzvQQJZAWuB1n0cZ0wNGRYkGn+w2UJv+Y3txlstCks+izfABdBMaNb4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709238576; c=relaxed/simple; bh=L/s/b9tSVs9z239pdMRuvKxK6VQN+DzuuFGrb2AJ0Ws=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DmyT7Ll6Te7b6YU0msQpfHkEuZUfxbFgr5L0UwH1UI0IrMpDY52Je7vEjfGQ5W5CNVBxP430k/1e0U1NPX6YcMIqtU5mKldWK0sap+DXWCLQVL03AGwm7Ianhvsyp9DZhzn6ISYEC/1KWRvAeOATDttfsQs1EcgsTwQs/IDNsj4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=OhCzDT6d; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id EF869FF802; Thu, 29 Feb 2024 20:29:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709238570; 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: in-reply-to:in-reply-to:references:references; bh=Xsz9d2+yFSQZeecH2hOJtT+4TSF8kgLSBhGXKWhoDpQ=; b=OhCzDT6diyX9INg49zfgB6KwEWfdYjAzQMAaaMbxmHZ7yT1l6ewOG/X0HJ120MHMVo/Hw2 ZfOIUYhTiqAVHadjdJMmkzkbxIP3hV0y5nyrK40vRfXJfV2lRtS/dIoK5oRs3TEFYQ+FrC pvDhHrPBDj6wx2nmTtjANKDIV1ovkCo5EWg+LU9ATvPEDVr6yDi19MIpYDmyBFTRIHJ2EF Wgg1Cd4id6LQdh51SlsqUDlRZIgIhUDb+nEtNMFj2XOI5FAw4iVyl4vBI8ZTpYVmr8F5ZO jFlEnUWaHt/p5RrZR8Mf47xH6KNbvdyJ3hb7TU0OFLOftZlrOlAXYAGlTMAKKg== Date: Thu, 29 Feb 2024 21:29:28 +0100 From: Alexandre Belloni To: Chris Packham Cc: Conor Dooley , "antoniu.miclaus@analog.com" , "robh+dt@kernel.org" , "krzysztof.kozlowski+dt@linaro.org" , "conor+dt@kernel.org" , "jdelvare@suse.com" , "linux@roeck-us.net" , "linux-rtc@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-hwmon@vger.kernel.org" , Zeynep Arslanbenzer Subject: Re: [PATCH v8 2/2] dt-bindings: rtc: add max313xx RTCs Message-ID: <2024022920292837621a4f@mail.local> References: <20240227010312.3305966-1-chris.packham@alliedtelesis.co.nz> <20240227010312.3305966-3-chris.packham@alliedtelesis.co.nz> <20240228-embark-rimmed-d81bab3d42b8@spud> <20240229-skeletal-ultimatum-27cd91e8d8a8@spud> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-GND-Sasl: alexandre.belloni@bootlin.com On 29/02/2024 20:11:16+0000, Chris Packham wrote: > > On 1/03/24 07:07, Conor Dooley wrote: > > On Wed, Feb 28, 2024 at 08:21:35PM +0000, Chris Packham wrote: > >> On 29/02/24 00:58, Conor Dooley wrote: > >>> On Tue, Feb 27, 2024 at 02:03:10PM +1300, Chris Packham wrote: > >>> > >>>> interrupts: > >>>> + description: > >>>> + Alarm1 interrupt line of the RTC. Some of the RTCs have two interrupt > >>>> + lines and alarm1 interrupt muxing depends on the clockin/clockout > >>>> + configuration. > >>>> maxItems: 1 > >>> The maxItems: 1 looks odd here when you state "some of the RTCs have two > >>> interrupt lines", which makes it sound as if there are actually two > >>> interrupts that should be exposed here. If those two interrupts get > >>> muxed to the same pin for output I'd suggest that you clarify that here. > >> This may end up changing if I can come up with something that Alexandre > >> is happy with. Basically (some of) the chips have a configurable pin > >> that can either be dedicated to the ALARM1 output (annoyingly labelled > >> as INTB) or to a clock output. There is an INTA line that has other > >> interrupts and if the clock output option is used then it also has > >> ALARM1. The driver doesn't currently do anything with the other > >> interrupt sources so as written this needs to correspond to whichever > >> interrupt output is asserted for ALARM1. > > So you're saying that depending on whether or not the clock output is > > used, there could be two interrupts? > Correct. > > Without looking further, it sounds like you should be setting maxItems > > to 1 if #clock-cells is present and to 2 if it is not. > My idea was an explicit property about the function of the INTB/CLKOUT > pin. The current code does use #clock-cells as a proxy for this (and > Alexandre has some concerns with how this is handled). #clock-cells must not be used for pinmuxing, I can't see how anyone would allow this. > > Then if there are > > two interrupts provided, the driver is free to configure whatever way it > > wants. If there aren't, send everything to INTA. > > > > Am I missing something? > > Right now the only interrupt that the RTC cares about is for ALARM1 > (which moves between INTA and INTB depending on the clock config). There > are other hardware events and an ALARM2 that can generate an interrupt > but these are ignored. I don't think the rtc framework supports more > than one alarm. > > Binding wise I think this should take 1 or 2 interrupts. For simplicity > the first interrupt should always correspond to ALARM1 (which could be > INTB or INTA depending on the hardware design). The 2nd interrupt (if > supplied) would be for the other events (which we don't currently do > anything with). Not using an interrupt simply means the CPU doesn't care about it but there are other components that may care for example a PMIC. If you reason about what linux and the CPU it is running on can do, you will cripple functionality and we will have to break the devicetree binding later on to restore it. We need to be able to express all the possible pin configurations with the binding. I'm not sure why everyone is so resistant to use pinmuxing to mux pins.... -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com