From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DBC8E33BBCD for ; Mon, 18 May 2026 10:57:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779101843; cv=none; b=CpKZ2oeRY75QDT406S7a85OTxSw9Qdtkr/fL2EJLelZy7HRt5Kc8Vkqbqh0ewjuZDxJrHWpAdx76KwdY7NPSq5spr079Mf28o5yWA/VMiqvOIQkyql3uKJ4DZFLw+N0U+amG1SZozQmAP3cxCPam0hAy6AWKuqw8hKBe7WyvV5M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779101843; c=relaxed/simple; bh=cPW19SXjJnBDAagt7qB0/bXd0/z1hFemivJL8yGhT14=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Fsgoh6zmwFVfbRwvCz8wW0t4oHPhPK92v1JGqygaL9I9z6JU2ze/n/uafu0pUwJeihZ6Uvv2ck3f13XgupxAD53i26trXNwQSJ0GyMYkJfiaZ7DlWh6lFvBBpgYAGz3dYdZVy4Ez7KmNdE9rQzR2GpsStOO9gZugk5bcwGylXUU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=DnErxNAP; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="DnErxNAP" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-488ff90d6c7so15428445e9.2 for ; Mon, 18 May 2026 03:57:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1779101834; x=1779706634; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=5ARy9rq4cIvrxa/NBCnY0lb4B/GYtx7QC9maKRt4gYo=; b=DnErxNAPHFGcS977h8LT1mGNAcyW2uOlHVFGI4VY2cQPnsFMj0orpds7g2MtTA93pk pegq2MwYUQxMfCRth10udT37YtXfDXwQ/LomFJ37YVMlUe2agrlTMZb4xbaIUkhoLyLM dmNFDmC+PH+33YHhmkC1Wr//2ZC6seZDuje7i6PNiyQa37TYwAVOhthN/ez5pEAxYh2T Um0FWGNkBBZMvFrc6MJz1qGQA0zDiKPZH4qjw5A2BrEHbZA1cXfgwcq5K00B+wqjz/2p 8XaXckHrqinZGWDGevqe5SptU1mrgnkLYHb3qZH1UlR9j0VSGWuIUvVC85kU8M0ise+B oaNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779101834; x=1779706634; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5ARy9rq4cIvrxa/NBCnY0lb4B/GYtx7QC9maKRt4gYo=; b=WTDE5tMC4td+KkiXuAWQDBpG/QmNpOPg0UxFo8P0ziT6tN0Q3XTDKxp+eksZ0r/r8w +zl+QLOa9DSeI/e2aQ0SNbmTdqy0wnlOsChPkkUdXgTDAvGATZ01Vyw/uaIpmEiaR1pS Z8vR4/nJNgME70S5+E4wcWU6Zb7gSVlJR7dhMNFMfD/pmGMNaTor4jQ0b6kQ52+q+S2B tAvYcNDuSq1E/lGsf8ymlszsccorFmghtK7p5v4KhQ0PlH4vX7MIxWOAcDsUrCVTM9FG CdK1UbVGLiVrLAFjLYPia2tWYmQbxGRGnDS4PX0/+3hxE5qCe+a/5W5wjc2KaNqiOWAd inUA== X-Forwarded-Encrypted: i=1; AFNElJ8PaX1HC8Zhj5L3JZeMce3+rWxXg+6w4eNIFwOfim5wfJLCtZKZDA6LfiobqNW0+LG/r7HRL2ummkZIOR8=@vger.kernel.org X-Gm-Message-State: AOJu0YwVk7Bjx8157cCkij+/zMWB0ueSzz6jdSyq6yy7gIJx+9dg2t0q cUVzeWwjR0VZgiVimKWwQKQ6/qNAOrOZ8oYr+xn6gsNKcdvO+ua7hF+FuRe0MdjN9UU= X-Gm-Gg: Acq92OHDYYQko1/qvDioFNI4JsKHiYpbGTYHDmGIdOal14Q/v6QDMIjaKLLv0504GIh GRsDXcwUQxQHtVCpWlKMK4SPedo1LJYtcZW1GlRtdfUjGSo29hT4wWDO6cKE6RyAIJpTRdpl+sx xyApzWC1BsBdcK4JOlcuMkkInLSTkvYQI9PssZ2OR94fbitrETofAl1aXdCmDovGi6TZP3kGPvS 5CmtLfXrgUO1hId1Iwr6swalcEJSEoPyc6zrZzZ8V6rtYFpZe9EUl9jSNpVQACrkykkXvQJ9PUR OV9C/VJFQrh2gxJ7463iuLR60+ZHOtnu5yK2YL8H17L4f/w4sifRA0KKdiGoHcXxiQEFd/4RHQK 1HLcWqVs7K3E3N5XAGeCPe7v95gNXe+bxGcpxUug08UrVYsJoIe5MF0RJ35fakndN4zduTHMpm/ d+sl81cZp2B4ICwZnfF+yHuXW9oDWX5oBGONvQViobHQ== X-Received: by 2002:a05:600c:8707:b0:48f:fddb:dcd9 with SMTP id 5b1f17b1804b1-48ffddbf75emr131962865e9.27.1779101834543; Mon, 18 May 2026 03:57:14 -0700 (PDT) Received: from [10.11.12.109] ([82.76.215.73]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48feb029180sm117010795e9.4.2026.05.18.03.57.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 May 2026 03:57:14 -0700 (PDT) Message-ID: <1c41ecc9-d951-45df-b933-1934e1381663@linaro.org> Date: Mon, 18 May 2026 13:57:11 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] clk: samsung: acpm: introduce driver data for SoC-specific clocks To: Alexey Klimov , Sam Protsenko , Krzysztof Kozlowski , Sylwester Nawrocki , Chanwoo Choi , Alim Akhtar , Michael Turquette , Stephen Boyd , Brian Masney Cc: linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260512-exynos850-acpm-clk-v1-0-837532ddbf38@linaro.org> <20260512-exynos850-acpm-clk-v1-1-837532ddbf38@linaro.org> Content-Language: en-US From: Tudor Ambarus In-Reply-To: <20260512-exynos850-acpm-clk-v1-1-837532ddbf38@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 5/12/26 11:40 PM, Alexey Klimov wrote: > Currently, the ACPM clock driver hardcodes the GS101 clock variant > arrays and counts directly in probe() routine. To support additional > other SoCs (for instance Exynos850 SoC) that use the same ACPM protocol > but have different clock trees, the driver needs to be more flexible. > > Introduce driver data attached to the platform_device_id table. > Update the probe function to dynamically extract the clock lists, > number of clocks, its names and mailbox channel id based on the matching > device ID. > > Signed-off-by: Alexey Klimov > --- > drivers/clk/samsung/clk-acpm.c | 17 ++++++++++++----- > 1 file changed, 12 insertions(+), 5 deletions(-) > > diff --git a/drivers/clk/samsung/clk-acpm.c b/drivers/clk/samsung/clk-acpm.c > index d8944160793a..604604b5b814 100644 > --- a/drivers/clk/samsung/clk-acpm.c > +++ b/drivers/clk/samsung/clk-acpm.c > @@ -113,6 +113,8 @@ static int acpm_clk_register(struct device *dev, struct acpm_clk *aclk, > > static int acpm_clk_probe(struct platform_device *pdev) > { > + const struct acpm_clk_driver_data *drv_data; > + const struct platform_device_id *id; > struct acpm_handle *acpm_handle; > struct clk_hw_onecell_data *clk_data; > struct clk_hw **hws; > @@ -126,8 +128,14 @@ static int acpm_clk_probe(struct platform_device *pdev) > return dev_err_probe(dev, PTR_ERR(acpm_handle), > "Failed to get acpm handle\n"); > > - count = acpm_clk_gs101.nr_clks; > - mbox_chan_id = acpm_clk_gs101.mbox_chan_id; > + id = platform_get_device_id(pdev); > + if (!id || !id->driver_data) > + return -ENODEV; > + > + drv_data = (const struct acpm_clk_driver_data *)id->driver_data; > + > + count = drv_data->nr_clks; > + mbox_chan_id = drv_data->mbox_chan_id; > > clk_data = devm_kzalloc(dev, struct_size(clk_data, hws, count), > GFP_KERNEL); > @@ -154,8 +162,7 @@ static int acpm_clk_probe(struct platform_device *pdev) > > hws[i] = &aclk->hw; > > - err = acpm_clk_register(dev, aclk, > - acpm_clk_gs101.clks[i].name); > + err = acpm_clk_register(dev, aclk, drv_data->clks[i].name); > if (err) > return dev_err_probe(dev, err, > "Failed to register clock\n"); > @@ -166,7 +173,7 @@ static int acpm_clk_probe(struct platform_device *pdev) > } > > static const struct platform_device_id acpm_clk_id[] = { > - { "gs101-acpm-clk" }, > + { "gs101-acpm-clk", (kernel_ulong_t)&acpm_clk_gs101 }, you need to include linux/mod_devicetable.h for kernel_ulong_t. With that: Reviewed-by: Tudor Ambarus > {} > }; > MODULE_DEVICE_TABLE(platform, acpm_clk_id); >