intel-lpss.c (cbd1c5c4d443c4a83c9c7eecc0561b9aeafddf50) intel-lpss.c (569fac74627cc332a2097a7a4bfdc654b8e7f273)
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>

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

123 .name = "pxa2xx-spi",
124 .num_resources = ARRAY_SIZE(intel_lpss_dev_resources),
125 .resources = intel_lpss_dev_resources,
126};
127
128static DEFINE_IDA(intel_lpss_devid_ida);
129static struct dentry *intel_lpss_debugfs;
130
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>

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

123 .name = "pxa2xx-spi",
124 .num_resources = ARRAY_SIZE(intel_lpss_dev_resources),
125 .resources = intel_lpss_dev_resources,
126};
127
128static DEFINE_IDA(intel_lpss_devid_ida);
129static struct dentry *intel_lpss_debugfs;
130
131static int intel_lpss_request_dma_module(const char *name)
132{
133 static bool intel_lpss_dma_requested;
134
135 if (intel_lpss_dma_requested)
136 return 0;
137
138 intel_lpss_dma_requested = true;
139 return request_module("%s", name);
140}
141
142static void intel_lpss_cache_ltr(struct intel_lpss *lpss)
143{
144 lpss->active_ltr = readl(lpss->priv + LPSS_PRIV_ACTIVELTR);
145 lpss->idle_ltr = readl(lpss->priv + LPSS_PRIV_IDLELTR);
146}
147
148static int intel_lpss_debugfs_add(struct intel_lpss *lpss)
149{

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

424
425 intel_lpss_ltr_expose(lpss);
426
427 ret = intel_lpss_debugfs_add(lpss);
428 if (ret)
429 dev_warn(dev, "Failed to create debugfs entries\n");
430
431 if (intel_lpss_has_idma(lpss)) {
131static void intel_lpss_cache_ltr(struct intel_lpss *lpss)
132{
133 lpss->active_ltr = readl(lpss->priv + LPSS_PRIV_ACTIVELTR);
134 lpss->idle_ltr = readl(lpss->priv + LPSS_PRIV_IDLELTR);
135}
136
137static int intel_lpss_debugfs_add(struct intel_lpss *lpss)
138{

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

413
414 intel_lpss_ltr_expose(lpss);
415
416 ret = intel_lpss_debugfs_add(lpss);
417 if (ret)
418 dev_warn(dev, "Failed to create debugfs entries\n");
419
420 if (intel_lpss_has_idma(lpss)) {
432 /*
433 * Ensure the DMA driver is loaded before the host
434 * controller device appears, so that the host controller
435 * driver can request its DMA channels as early as
436 * possible.
437 *
438 * If the DMA module is not there that's OK as well.
439 */
440 intel_lpss_request_dma_module(LPSS_IDMA64_DRIVER_NAME);
441
442 ret = mfd_add_devices(dev, lpss->devid, &intel_lpss_idma64_cell,
443 1, info->mem, info->irq, NULL);
444 if (ret)
445 dev_warn(dev, "Failed to add %s, fallback to PIO\n",
446 LPSS_IDMA64_DRIVER_NAME);
447 }
448
449 ret = mfd_add_devices(dev, lpss->devid, lpss->cell,

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

549module_exit(intel_lpss_exit);
550
551MODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>");
552MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>");
553MODULE_AUTHOR("Heikki Krogerus <heikki.krogerus@linux.intel.com>");
554MODULE_AUTHOR("Jarkko Nikula <jarkko.nikula@linux.intel.com>");
555MODULE_DESCRIPTION("Intel LPSS core driver");
556MODULE_LICENSE("GPL v2");
421 ret = mfd_add_devices(dev, lpss->devid, &intel_lpss_idma64_cell,
422 1, info->mem, info->irq, NULL);
423 if (ret)
424 dev_warn(dev, "Failed to add %s, fallback to PIO\n",
425 LPSS_IDMA64_DRIVER_NAME);
426 }
427
428 ret = mfd_add_devices(dev, lpss->devid, lpss->cell,

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

528module_exit(intel_lpss_exit);
529
530MODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>");
531MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>");
532MODULE_AUTHOR("Heikki Krogerus <heikki.krogerus@linux.intel.com>");
533MODULE_AUTHOR("Jarkko Nikula <jarkko.nikula@linux.intel.com>");
534MODULE_DESCRIPTION("Intel LPSS core driver");
535MODULE_LICENSE("GPL v2");
536/*
537 * Ensure the DMA driver is loaded before the host controller device appears,
538 * so that the host controller driver can request its DMA channels as early
539 * as possible.
540 *
541 * If the DMA module is not there that's OK as well.
542 */
543MODULE_SOFTDEP("pre: platform:" LPSS_IDMA64_DRIVER_NAME);