aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pwm/pwm-lpss-platform.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-10-07 11:32:10 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2022-10-07 11:32:10 -0700
commit3fb55dd14036b875b96c39d6e18fc53feb891891 (patch)
tree6c8edb69fea25d78c8bfed62bbf1a42e543e8b49 /drivers/pwm/pwm-lpss-platform.c
parentMerge tag 'mfd-next-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd (diff)
parentpwm: sysfs: Replace sprintf() with sysfs_emit() (diff)
downloadlinux-dev-3fb55dd14036b875b96c39d6e18fc53feb891891.tar.xz
linux-dev-3fb55dd14036b875b96c39d6e18fc53feb891891.zip
Merge tag 'pwm/for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm
Pull pwm updates from Thierry Reding: "The Rockchip and Mediatek drivers gain support for more chips and the LPSS driver undergoes some refactoring and receives some improvements. Other than that there are various cleanups of the core" * tag 'pwm/for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: pwm: sysfs: Replace sprintf() with sysfs_emit() pwm: core: Replace custom implementation of device_match_fwnode() pwm: lpss: Add a comment to the bypass field pwm: lpss: Make use of bits.h macros for all masks pwm: lpss: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macros pwm: lpss: Use device_get_match_data() to get device data pwm: lpss: Move resource mapping to the glue drivers pwm: lpss: Move exported symbols to PWM_LPSS namespace pwm: lpss: Deduplicate board info data structures dt-bindings: pwm: Add compatible for Mediatek MT8188 dt-bindings: pwm: rockchip: Add rockchip,rk3128-pwm dt-bindings: pwm: rockchip: Add description for rk3588 pwm: sysfs: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() pwm: rockchip: Convert to use dev_err_probe()
Diffstat (limited to 'drivers/pwm/pwm-lpss-platform.c')
-rw-r--r--drivers/pwm/pwm-lpss-platform.c40
1 files changed, 10 insertions, 30 deletions
diff --git a/drivers/pwm/pwm-lpss-platform.c b/drivers/pwm/pwm-lpss-platform.c
index 928570430cef..c48c6f2b2cd8 100644
--- a/drivers/pwm/pwm-lpss-platform.c
+++ b/drivers/pwm/pwm-lpss-platform.c
@@ -7,52 +7,31 @@
* Derived from the original pwm-lpss.c
*/
-#include <linux/acpi.h>
#include <linux/kernel.h>
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
+#include <linux/property.h>
#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;
- const struct acpi_device_id *id;
struct pwm_lpss_chip *lpwm;
- struct resource *r;
+ void __iomem *base;
- id = acpi_match_device(pdev->dev.driver->acpi_match_table, &pdev->dev);
- if (!id)
+ info = device_get_match_data(&pdev->dev);
+ if (!info)
return -ENODEV;
- info = (const struct pwm_lpss_boardinfo *)id->driver_data;
- r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(base))
+ return PTR_ERR(base);
- lpwm = pwm_lpss_probe(&pdev->dev, r, info);
+ lpwm = pwm_lpss_probe(&pdev->dev, base, info);
if (IS_ERR(lpwm))
return PTR_ERR(lpwm);
@@ -110,4 +89,5 @@ module_platform_driver(pwm_lpss_driver_platform);
MODULE_DESCRIPTION("PWM platform driver for Intel LPSS");
MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(PWM_LPSS);
MODULE_ALIAS("platform:pwm-lpss");