From nobody Fri Dec 19 17:18:11 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 056A128B3ED for ; Wed, 7 May 2025 15:26:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746631568; cv=none; b=GNoEUtD5Qk7D7Mz0EJ8Hcv1wWlQTCq41YOsrgwceMFGo889ilX99gRQ983KW/F1BlcPc5xBeHbCarjDWB7ybnJ62gmX9fL5SrJwcYzxNAuBVLQQ5s0C7Qrp3Zznu1/X8rKXsL2yd26WiBqNCQ8tEUgSdV25nsbtDVezzduDvCfc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746631568; c=relaxed/simple; bh=sKo4FtZtdnOcvr1oQuz2XBroEwdboLpu4/AAykZ6Geg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Pa7dKxtbiwIKiNtV4RifTohksYY4C7A7n8DdinBX1LFsHhlj0wISDfv0eptfRioZPoS038QyCOH2wsN3YqrhuwXcuJ6Vve+LshZSQuvzsNhAu1c+U3DOdakdGmHjj7VkqffBcNTVDoVpPVIIX6U8UxVQlgtMaIDk3G3VR8BTT7o= 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=KYk1MjWe; arc=none smtp.client-ip=170.10.133.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="KYk1MjWe" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1746631566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=N7rsTQVkWdVuIH2kV4e5IulN3mEFFY4EL8PR2r1zcwQ=; b=KYk1MjWeoocHoeLlFgf9A38V6/AYnrF+O399UGTlneCxdxbR1lNiVNpyV+Gsl8USB73+wc 0IBb+em9zgnlxfBrn+OQIjQcQ0kI3QgGERvMLrJD16gZHGEhc19myZbE5GtETk9h1qhmT0 lWWe+FEMd9wR3QoCoWCBsSHGWMTLJIw= Received: from mx-prod-mc-02.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-122-NNlbYunAN0qPtBkYUzqRVg-1; Wed, 07 May 2025 11:26:01 -0400 X-MC-Unique: NNlbYunAN0qPtBkYUzqRVg-1 X-Mimecast-MFC-AGG-ID: NNlbYunAN0qPtBkYUzqRVg_1746631559 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6FB2E195608C; Wed, 7 May 2025 15:25:59 +0000 (UTC) Received: from p16v.luc.cera.cz (unknown [10.44.33.91]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 46E9230001AA; Wed, 7 May 2025 15:25:54 +0000 (UTC) From: Ivan Vecera To: netdev@vger.kernel.org Cc: Vadim Fedorenko , Arkadiusz Kubalewski , Jiri Pirko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Prathosh Satish , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Simon Horman , Lee Jones , Andy Shevchenko , Michal Schmidt , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH net-next v8 8/8] mfd: zl3073x: Register DPLL sub-device during init Date: Wed, 7 May 2025 17:25:04 +0200 Message-ID: <20250507152504.85341-9-ivecera@redhat.com> In-Reply-To: <20250507152504.85341-1-ivecera@redhat.com> References: <20250507152504.85341-1-ivecera@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Content-Type: text/plain; charset="utf-8" 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 --- v7->v8: * replaced zl3073x_pdata array ZL3073X_PDATA macro v6->v7: * use platform data to pass the channel to use v4->v6: * no change v3->v4: * use static mfd cells --- drivers/mfd/zl3073x-core.c | 27 +++++++++++++++++++++++++++ include/linux/mfd/zl3073x.h | 9 +++++++++ 2 files changed, 36 insertions(+) diff --git a/drivers/mfd/zl3073x-core.c b/drivers/mfd/zl3073x-core.c index 0bea696a46b8..7b140b614a63 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,23 @@ static void zl3073x_devlink_unregister(void *ptr) devlink_unregister(ptr); } =20 +#define ZL3073X_PDATA(_channel) \ + (&(const struct zl3073x_pdata) { \ + .channel =3D _channel, \ + }) + +#define ZL3073X_CELL(_name, _channel) \ + MFD_CELL_BASIC(_name, NULL, ZL3073X_PDATA(_channel), \ + sizeof(struct zl3073x_pdata), 0) + +static const struct mfd_cell zl3073x_devs[] =3D { + ZL3073X_CELL("zl3073x-dpll", 0), + ZL3073X_CELL("zl3073x-dpll", 1), + ZL3073X_CELL("zl3073x-dpll", 2), + ZL3073X_CELL("zl3073x-dpll", 3), + ZL3073X_CELL("zl3073x-dpll", 4), +}; + /** * zl3073x_dev_probe - initialize zl3073x device * @zldev: pointer to zl3073x device @@ -826,6 +844,15 @@ int zl3073x_dev_probe(struct zl3073x_dev *zldev, if (rc) return rc; =20 + /* Add DPLL sub-device cell for each DPLL channel */ + rc =3D devm_mfd_add_devices(zldev->dev, PLATFORM_DEVID_AUTO, zl3073x_devs, + chip_info->num_channels, NULL, 0, NULL); + if (rc) { + dev_err_probe(zldev->dev, rc, + "Failed to add DPLL sub-device\n"); + return rc; + } + /* Register the device as devlink device */ devlink =3D priv_to_devlink(zldev); devlink_register(devlink); diff --git a/include/linux/mfd/zl3073x.h b/include/linux/mfd/zl3073x.h index 4dc68013b69f..cf4663cab72a 100644 --- a/include/linux/mfd/zl3073x.h +++ b/include/linux/mfd/zl3073x.h @@ -12,6 +12,7 @@ struct regmap; /* * Hardware limits for ZL3073x chip family */ +#define ZL3073X_MAX_CHANNELS 5 #define ZL3073X_NUM_INPUTS 10 #define ZL3073X_NUM_OUTPUTS 10 #define ZL3073X_NUM_SYNTHS 5 @@ -48,6 +49,14 @@ struct zl3073x_synth { u8 dpll; }; =20 +/** + * struct zl3073x_pdata - zl3073x sub-device platform data + * @channel: channel to use + */ +struct zl3073x_pdata { + u8 channel; +}; + /** * struct zl3073x_dev - zl3073x device * @dev: pointer to device --=20 2.49.0