From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 428A627A103 for ; Wed, 7 May 2025 12:36:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746621398; cv=none; b=oE+SumYqJD/kqdw3czoBM5u05alaro7tRwZu4EXwfxTIvXnBWBc8K3BVrJps3HwPTTn1PYZ4/89Y6FUDYJe3t7pGjaJeHYfZWJn3vC4pb60U4AjBbbInbthm/69kOy2o7nIfuEaOyS4qPg2Wlc7BS+U3kCyEpsuq5x6Br2WcjLI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746621398; c=relaxed/simple; bh=ANQL2Z2mMkbXRvzftivNBYyTpd2FsjheCIMPkPyIky0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ChAiw9KACofcty3L2+punD4qhEjGTZopIly2fwZl/6I5Gb2sb25vRaOGli+l0SdbLiD7EJxPDqMiLFARUN4/pAZbYXzjPdArGN4KxSGxgS8519h/a2q2lzWd+ZVIQ/RTax++4k2vLh9rT2jtSdsAchspWoeTfOlTgOYc/Z99rds= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=HyTpaWuP; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="HyTpaWuP" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1746621395; 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=R4OangMaKmpfQS75O4hoSdU6AYI1lR2PZPMYPMmrmQc=; b=HyTpaWuPCNivfzvqfScWsns6YFYFqhDBXVFr/1THkbPC2YSJ1ocd+wPUD13mgE+DFXEskx 1CQi8AhwASvlES3AWZRCsvco762ApxoS5qEa0i+fJXRuW7v+vJQHcm9C+wrb3T887rIXhR 6hGQuo1c5eCDfcCwGb4M4Gzc/OWAiZg= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-301-TZ32l5kDOH2JZUq_QcgFLg-1; Wed, 07 May 2025 08:36:30 -0400 X-MC-Unique: TZ32l5kDOH2JZUq_QcgFLg-1 X-Mimecast-MFC-AGG-ID: TZ32l5kDOH2JZUq_QcgFLg_1746621388 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 52F141955DE8; Wed, 7 May 2025 12:36:28 +0000 (UTC) Received: from [10.44.33.91] (unknown [10.44.33.91]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C65371953B85; Wed, 7 May 2025 12:36:22 +0000 (UTC) Message-ID: Date: Wed, 7 May 2025 14:36:21 +0200 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v6 8/8] mfd: zl3073x: Register DPLL sub-device during init To: Lee Jones Cc: netdev@vger.kernel.org, Vadim Fedorenko , Arkadiusz Kubalewski , Jiri Pirko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Prathosh Satish , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Simon Horman , Andy Shevchenko , Michal Schmidt , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org References: <20250430101126.83708-1-ivecera@redhat.com> <20250430101126.83708-9-ivecera@redhat.com> <20250501132201.GP1567507@google.com> <20250507110621.GJ3865826@google.com> Content-Language: en-US From: Ivan Vecera In-Reply-To: <20250507110621.GJ3865826@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 On 07. 05. 25 1:06 odp., Lee Jones wrote: > On Fri, 02 May 2025, Ivan Vecera wrote: > >> >> >> On 01. 05. 25 3:22 odp., Lee Jones wrote: >>> On Wed, 30 Apr 2025, Ivan Vecera wrote: >>> >>>> Register DPLL sub-devices to expose the functionality provided >>>> by ZL3073x chip family. Each sub-device represents one of >>>> the available DPLL channels. >>>> >>>> Signed-off-by: Ivan Vecera >>>> --- >>>> v4->v6: >>>> * no change >>>> v3->v4: >>>> * use static mfd cells >>>> --- >>>> drivers/mfd/zl3073x-core.c | 19 +++++++++++++++++++ >>>> 1 file changed, 19 insertions(+) >>>> >>>> diff --git a/drivers/mfd/zl3073x-core.c b/drivers/mfd/zl3073x-core.c >>>> index 050dc57c90c3..3e665cdf228f 100644 >>>> --- a/drivers/mfd/zl3073x-core.c >>>> +++ b/drivers/mfd/zl3073x-core.c >>>> @@ -7,6 +7,7 @@ >>>> #include >>>> #include >>>> #include >>>> +#include >>>> #include >>>> #include >>>> #include >>>> @@ -755,6 +756,14 @@ static void zl3073x_devlink_unregister(void *ptr) >>>> devlink_unregister(ptr); >>>> } >>>> +static const struct mfd_cell zl3073x_dpll_cells[] = { >>>> + MFD_CELL_BASIC("zl3073x-dpll", NULL, NULL, 0, 0), >>>> + MFD_CELL_BASIC("zl3073x-dpll", NULL, NULL, 0, 1), >>>> + MFD_CELL_BASIC("zl3073x-dpll", NULL, NULL, 0, 2), >>>> + MFD_CELL_BASIC("zl3073x-dpll", NULL, NULL, 0, 3), >>>> + MFD_CELL_BASIC("zl3073x-dpll", NULL, NULL, 0, 4), >>>> +}; >>> >>> What other devices / subsystems will be involved when this is finished? >> >> Lee, btw. I noticed from another discussion that you mentioned that >> mfd_cell->id should not be used outside MFD. >> >> My sub-drivers uses this to get DPLL channel number that should be used >> for the particular sub-device. >> >> E.g. >> 1) MFD_CELL_BASIC("zl3073x-dpll", NULL, NULL, 0, 2); >> 2) MFD_CELL_BASIC("zl3073x-phc", NULL, NULL, 0, 3); >> >> In these cases dpll_zl3073x sub-driver will use DPLL channel 2 for this >> DPLL sub-device and ptp_zl3073x sub-driver will use DPLL channel 3 for >> this PHC sub-device. >> >> platform_device->id cannot be used for this purpose in conjunction with >> PLATFORM_DEVID_AUTO as that ->id can be arbitrary. >> >> So if I cannot use mfd_cell->id what should I use for that case? >> Platform data per cell with e.g. the DPLL channel number? > > Yes, using the device ID for anything other than enumeration is a hack. > > Channel numbers and the like should be passed as platform data. OK, I will send v7 quickly. Ivan