All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/9] pwm: lpss: Deduplicate board info data structures
@ 2022-09-06 19:57 Andy Shevchenko
  2022-09-06 19:57 ` [PATCH v1 2/9] pwm: lpss: Move exported symbols to PWM_LPSS namespace Andy Shevchenko
                   ` (8 more replies)
  0 siblings, 9 replies; 18+ messages in thread
From: Andy Shevchenko @ 2022-09-06 19:57 UTC (permalink / raw)
  To: Andy Shevchenko, linux-kernel, linux-pwm
  Cc: Thierry Reding, Uwe Kleine-König

With help of __maybe_unused, that allows to avoid compilation warnings,
move the board info structures from the C files to the common header
and hence deduplicate configuration data.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pwm/pwm-lpss-pci.c      | 29 -----------------------------
 drivers/pwm/pwm-lpss-platform.c | 23 -----------------------
 drivers/pwm/pwm-lpss.h          | 30 ++++++++++++++++++++++++++++++
 3 files changed, 30 insertions(+), 52 deletions(-)

diff --git a/drivers/pwm/pwm-lpss-pci.c b/drivers/pwm/pwm-lpss-pci.c
index c893ec3d2fb4..75b778e839b3 100644
--- a/drivers/pwm/pwm-lpss-pci.c
+++ b/drivers/pwm/pwm-lpss-pci.c
@@ -14,35 +14,6 @@
 
 #include "pwm-lpss.h"
 
-/* BayTrail */
-static const struct pwm_lpss_boardinfo pwm_lpss_byt_info = {
-	.clk_rate = 25000000,
-	.npwm = 1,
-	.base_unit_bits = 16,
-};
-
-/* Braswell */
-static const struct pwm_lpss_boardinfo pwm_lpss_bsw_info = {
-	.clk_rate = 19200000,
-	.npwm = 1,
-	.base_unit_bits = 16,
-};
-
-/* Broxton */
-static const struct pwm_lpss_boardinfo pwm_lpss_bxt_info = {
-	.clk_rate = 19200000,
-	.npwm = 4,
-	.base_unit_bits = 22,
-	.bypass = true,
-};
-
-/* Tangier */
-static const struct pwm_lpss_boardinfo pwm_lpss_tng_info = {
-	.clk_rate = 19200000,
-	.npwm = 4,
-	.base_unit_bits = 22,
-};
-
 static int pwm_lpss_probe_pci(struct pci_dev *pdev,
 			      const struct pci_device_id *id)
 {
diff --git a/drivers/pwm/pwm-lpss-platform.c b/drivers/pwm/pwm-lpss-platform.c
index 928570430cef..fcd80cca2f6d 100644
--- a/drivers/pwm/pwm-lpss-platform.c
+++ b/drivers/pwm/pwm-lpss-platform.c
@@ -15,29 +15,6 @@
 
 #include "pwm-lpss.h"
 
-/* BayTrail */
-static const struct pwm_lpss_boardinfo pwm_lpss_byt_info = {
-	.clk_rate = 25000000,
-	.npwm = 1,
-	.base_unit_bits = 16,
-};
-
-/* Braswell */
-static const struct pwm_lpss_boardinfo pwm_lpss_bsw_info = {
-	.clk_rate = 19200000,
-	.npwm = 1,
-	.base_unit_bits = 16,
-	.other_devices_aml_touches_pwm_regs = true,
-};
-
-/* Broxton */
-static const struct pwm_lpss_boardinfo pwm_lpss_bxt_info = {
-	.clk_rate = 19200000,
-	.npwm = 4,
-	.base_unit_bits = 22,
-	.bypass = true,
-};
-
 static int pwm_lpss_probe_platform(struct platform_device *pdev)
 {
 	const struct pwm_lpss_boardinfo *info;
diff --git a/drivers/pwm/pwm-lpss.h b/drivers/pwm/pwm-lpss.h
index 8b3476f25e06..3864f32c2487 100644
--- a/drivers/pwm/pwm-lpss.h
+++ b/drivers/pwm/pwm-lpss.h
@@ -33,6 +33,36 @@ struct pwm_lpss_boardinfo {
 	bool other_devices_aml_touches_pwm_regs;
 };
 
+/* BayTrail */
+static __maybe_unused const struct pwm_lpss_boardinfo pwm_lpss_byt_info = {
+	.clk_rate = 25000000,
+	.npwm = 1,
+	.base_unit_bits = 16,
+};
+
+/* Braswell */
+static __maybe_unused const struct pwm_lpss_boardinfo pwm_lpss_bsw_info = {
+	.clk_rate = 19200000,
+	.npwm = 1,
+	.base_unit_bits = 16,
+	.other_devices_aml_touches_pwm_regs = true,
+};
+
+/* Broxton */
+static __maybe_unused const struct pwm_lpss_boardinfo pwm_lpss_bxt_info = {
+	.clk_rate = 19200000,
+	.npwm = 4,
+	.base_unit_bits = 22,
+	.bypass = true,
+};
+
+/* Tangier */
+static __maybe_unused const struct pwm_lpss_boardinfo pwm_lpss_tng_info = {
+	.clk_rate = 19200000,
+	.npwm = 4,
+	.base_unit_bits = 22,
+};
+
 struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, struct resource *r,
 				     const struct pwm_lpss_boardinfo *info);
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2022-09-08  8:26 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-06 19:57 [PATCH v1 1/9] pwm: lpss: Deduplicate board info data structures Andy Shevchenko
2022-09-06 19:57 ` [PATCH v1 2/9] pwm: lpss: Move exported symbols to PWM_LPSS namespace Andy Shevchenko
2022-09-07  9:11   ` Uwe Kleine-König
2022-09-07 14:21     ` Andy Shevchenko
2022-09-07 17:00       ` Andy Shevchenko
2022-09-07 17:14         ` Andy Shevchenko
2022-09-06 19:57 ` [PATCH v1 3/9] pwm: lpss: Move resource mapping to the glue drivers Andy Shevchenko
2022-09-06 19:57 ` [PATCH v1 4/9] pwm: lpss: Include headers we are direct user of Andy Shevchenko
2022-09-07  9:13   ` Uwe Kleine-König
2022-09-07 14:23     ` Andy Shevchenko
2022-09-06 19:57 ` [PATCH v1 5/9] pwm: lpss: Use device_get_match_data to get device data Andy Shevchenko
2022-09-06 19:57 ` [PATCH v1 6/9] pwm: lpss: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macros Andy Shevchenko
2022-09-06 19:57 ` [PATCH v1 7/9] pwm: lpss: Make use of bits.h macros for all masks Andy Shevchenko
2022-09-06 19:57 ` [PATCH v1 8/9] pwm: lpss: Add a comment to the bypass field Andy Shevchenko
2022-09-06 19:57 ` [PATCH v1 9/9] pwm: lpss: Allow other drivers to enable PWM LPSS Andy Shevchenko
2022-09-07  9:04 ` [PATCH v1 1/9] pwm: lpss: Deduplicate board info data structures Uwe Kleine-König
2022-09-07 14:27   ` Andy Shevchenko
2022-09-08  8:25     ` Uwe Kleine-König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.