intel-lpss.c (cdd5b5a9761fd66d17586e4f4ba6588c70e640ea) intel-lpss.c (895243c8763e9c81cace2d526d9770fa1ad035a2)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Intel Sunrisepoint LPSS core support.
4 *
5 * Copyright (C) 2015, Intel Corporation
6 *
7 * Authors: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
8 * Mika Westerberg <mika.westerberg@linux.intel.com>

--- 391 unchanged lines hidden (view full) ---

400 if (ret)
401 return ret;
402
403 lpss->cell->swnode = info->swnode;
404 lpss->cell->ignore_resource_conflicts = info->ignore_resource_conflicts;
405
406 intel_lpss_init_dev(lpss);
407
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Intel Sunrisepoint LPSS core support.
4 *
5 * Copyright (C) 2015, Intel Corporation
6 *
7 * Authors: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
8 * Mika Westerberg <mika.westerberg@linux.intel.com>

--- 391 unchanged lines hidden (view full) ---

400 if (ret)
401 return ret;
402
403 lpss->cell->swnode = info->swnode;
404 lpss->cell->ignore_resource_conflicts = info->ignore_resource_conflicts;
405
406 intel_lpss_init_dev(lpss);
407
408 lpss->devid = ida_simple_get(&intel_lpss_devid_ida, 0, 0, GFP_KERNEL);
408 lpss->devid = ida_alloc(&intel_lpss_devid_ida, GFP_KERNEL);
409 if (lpss->devid < 0)
410 return lpss->devid;
411
412 ret = intel_lpss_register_clock(lpss);
413 if (ret)
414 goto err_clk_register;
415
416 intel_lpss_ltr_expose(lpss);

--- 20 unchanged lines hidden (view full) ---

437 return 0;
438
439err_remove_ltr:
440 intel_lpss_debugfs_remove(lpss);
441 intel_lpss_ltr_hide(lpss);
442 intel_lpss_unregister_clock(lpss);
443
444err_clk_register:
409 if (lpss->devid < 0)
410 return lpss->devid;
411
412 ret = intel_lpss_register_clock(lpss);
413 if (ret)
414 goto err_clk_register;
415
416 intel_lpss_ltr_expose(lpss);

--- 20 unchanged lines hidden (view full) ---

437 return 0;
438
439err_remove_ltr:
440 intel_lpss_debugfs_remove(lpss);
441 intel_lpss_ltr_hide(lpss);
442 intel_lpss_unregister_clock(lpss);
443
444err_clk_register:
445 ida_simple_remove(&intel_lpss_devid_ida, lpss->devid);
445 ida_free(&intel_lpss_devid_ida, lpss->devid);
446
447 return ret;
448}
449EXPORT_SYMBOL_GPL(intel_lpss_probe);
450
451void intel_lpss_remove(struct device *dev)
452{
453 struct intel_lpss *lpss = dev_get_drvdata(dev);
454
455 mfd_remove_devices(dev);
456 intel_lpss_debugfs_remove(lpss);
457 intel_lpss_ltr_hide(lpss);
458 intel_lpss_unregister_clock(lpss);
446
447 return ret;
448}
449EXPORT_SYMBOL_GPL(intel_lpss_probe);
450
451void intel_lpss_remove(struct device *dev)
452{
453 struct intel_lpss *lpss = dev_get_drvdata(dev);
454
455 mfd_remove_devices(dev);
456 intel_lpss_debugfs_remove(lpss);
457 intel_lpss_ltr_hide(lpss);
458 intel_lpss_unregister_clock(lpss);
459 ida_simple_remove(&intel_lpss_devid_ida, lpss->devid);
459 ida_free(&intel_lpss_devid_ida, lpss->devid);
460}
461EXPORT_SYMBOL_GPL(intel_lpss_remove);
462
463#ifdef CONFIG_PM
464static int resume_lpss_device(struct device *dev, void *data)
465{
466 if (!dev_pm_test_driver_flags(dev, DPM_FLAG_SMART_SUSPEND))
467 pm_runtime_resume(dev);

--- 80 unchanged lines hidden ---
460}
461EXPORT_SYMBOL_GPL(intel_lpss_remove);
462
463#ifdef CONFIG_PM
464static int resume_lpss_device(struct device *dev, void *data)
465{
466 if (!dev_pm_test_driver_flags(dev, DPM_FLAG_SMART_SUSPEND))
467 pm_runtime_resume(dev);

--- 80 unchanged lines hidden ---