Lines Matching +full:idma +full:- +full:addr
18 #include <linux/clk-provider.h>
29 #include <linux/io-64-nonatomic-lo-hi.h>
31 #include "intel-lpss.h"
41 /* Offsets from lpss->priv */
102 * Cells needs to be ordered so that the iDMA is created first. This is
119 .name = "dw-apb-uart",
125 .name = "pxa2xx-spi",
146 lpss->active_ltr = readl(lpss->priv + LPSS_PRIV_ACTIVELTR); in intel_lpss_cache_ltr()
147 lpss->idle_ltr = readl(lpss->priv + LPSS_PRIV_IDLELTR); in intel_lpss_cache_ltr()
154 dir = debugfs_create_dir(dev_name(lpss->dev), intel_lpss_debugfs); in intel_lpss_debugfs_add()
161 debugfs_create_x32("capabilities", S_IRUGO, dir, &lpss->caps); in intel_lpss_debugfs_add()
162 debugfs_create_x32("active_ltr", S_IRUGO, dir, &lpss->active_ltr); in intel_lpss_debugfs_add()
163 debugfs_create_x32("idle_ltr", S_IRUGO, dir, &lpss->idle_ltr); in intel_lpss_debugfs_add()
165 lpss->debugfs = dir; in intel_lpss_debugfs_add()
171 debugfs_remove_recursive(lpss->debugfs); in intel_lpss_debugfs_remove()
184 ltr = readl(lpss->priv + LPSS_PRIV_ACTIVELTR); in intel_lpss_ltr_set()
199 if (ltr == lpss->active_ltr) in intel_lpss_ltr_set()
202 writel(ltr, lpss->priv + LPSS_PRIV_ACTIVELTR); in intel_lpss_ltr_set()
203 writel(ltr, lpss->priv + LPSS_PRIV_IDLELTR); in intel_lpss_ltr_set()
211 lpss->dev->power.set_latency_tolerance = intel_lpss_ltr_set; in intel_lpss_ltr_expose()
212 dev_pm_qos_expose_latency_tolerance(lpss->dev); in intel_lpss_ltr_expose()
217 dev_pm_qos_hide_latency_tolerance(lpss->dev); in intel_lpss_ltr_hide()
218 lpss->dev->power.set_latency_tolerance = NULL; in intel_lpss_ltr_hide()
226 type = lpss->caps & LPSS_PRIV_CAPS_TYPE_MASK; in intel_lpss_assign_devs()
240 return -ENODEV; in intel_lpss_assign_devs()
243 lpss->cell = devm_kmemdup(lpss->dev, cell, sizeof(*cell), GFP_KERNEL); in intel_lpss_assign_devs()
244 if (!lpss->cell) in intel_lpss_assign_devs()
245 return -ENOMEM; in intel_lpss_assign_devs()
247 lpss->type = type; in intel_lpss_assign_devs()
254 return (lpss->caps & LPSS_PRIV_CAPS_NO_IDMA) == 0; in intel_lpss_has_idma()
259 resource_size_t addr = lpss->info->mem->start; in intel_lpss_set_remap_addr() local
261 lo_hi_writeq(addr, lpss->priv + LPSS_PRIV_REMAP_ADDR); in intel_lpss_set_remap_addr()
269 writel(value, lpss->priv + LPSS_PRIV_RESETS); in intel_lpss_deassert_reset()
277 writel(0, lpss->priv + LPSS_PRIV_RESETS); in intel_lpss_init_dev()
286 /* Make sure that SPI multiblock DMA transfers are re-enabled */ in intel_lpss_init_dev()
287 if (lpss->type == LPSS_DEV_SPI) in intel_lpss_init_dev()
288 writel(value, lpss->priv + LPSS_PRIV_SSP_REG); in intel_lpss_init_dev()
309 snprintf(name, sizeof(name), "%s-enable", devname); in intel_lpss_register_clock_divider()
311 lpss->priv, 0, 0, NULL); in intel_lpss_register_clock_divider()
315 snprintf(name, sizeof(name), "%s-div", devname); in intel_lpss_register_clock_divider()
317 0, lpss->priv, 1, 15, 16, 15, 0, in intel_lpss_register_clock_divider()
323 snprintf(name, sizeof(name), "%s-update", devname); in intel_lpss_register_clock_divider()
325 CLK_SET_RATE_PARENT, lpss->priv, 31, 0, NULL); in intel_lpss_register_clock_divider()
335 const struct mfd_cell *cell = lpss->cell; in intel_lpss_register_clock()
340 if (!lpss->info->clk_rate) in intel_lpss_register_clock()
344 clk = clk_register_fixed_rate(NULL, dev_name(lpss->dev), NULL, 0, in intel_lpss_register_clock()
345 lpss->info->clk_rate); in intel_lpss_register_clock()
349 snprintf(devname, sizeof(devname), "%s.%d", cell->name, lpss->devid); in intel_lpss_register_clock()
355 if (lpss->type != LPSS_DEV_I2C) { in intel_lpss_register_clock()
361 ret = -ENOMEM; in intel_lpss_register_clock()
364 lpss->clock = clkdev_create(clk, lpss->info->clk_con_id, "%s", devname); in intel_lpss_register_clock()
365 if (!lpss->clock) in intel_lpss_register_clock()
368 lpss->clk = clk; in intel_lpss_register_clock()
380 if (IS_ERR_OR_NULL(lpss->clk)) in intel_lpss_unregister_clock()
383 clkdev_drop(lpss->clock); in intel_lpss_unregister_clock()
384 intel_lpss_unregister_clock_tree(lpss->clk); in intel_lpss_unregister_clock()
393 if (!info || !info->mem || info->irq <= 0) in intel_lpss_probe()
394 return -EINVAL; in intel_lpss_probe()
398 return -ENOMEM; in intel_lpss_probe()
400 lpss->priv = devm_ioremap_uc(dev, info->mem->start + LPSS_PRIV_OFFSET, in intel_lpss_probe()
402 if (!lpss->priv) in intel_lpss_probe()
403 return -ENOMEM; in intel_lpss_probe()
405 lpss->info = info; in intel_lpss_probe()
406 lpss->dev = dev; in intel_lpss_probe()
407 lpss->caps = readl(lpss->priv + LPSS_PRIV_CAPS); in intel_lpss_probe()
415 lpss->cell->properties = info->properties; in intel_lpss_probe()
419 lpss->devid = ida_simple_get(&intel_lpss_devid_ida, 0, 0, GFP_KERNEL); in intel_lpss_probe()
420 if (lpss->devid < 0) in intel_lpss_probe()
421 return lpss->devid; in intel_lpss_probe()
444 ret = mfd_add_devices(dev, lpss->devid, &intel_lpss_idma64_cell, in intel_lpss_probe()
445 1, info->mem, info->irq, NULL); in intel_lpss_probe()
451 ret = mfd_add_devices(dev, lpss->devid, lpss->cell, in intel_lpss_probe()
452 1, info->mem, info->irq, NULL); in intel_lpss_probe()
466 ida_simple_remove(&intel_lpss_devid_ida, lpss->devid); in intel_lpss_probe()
480 ida_simple_remove(&intel_lpss_devid_ida, lpss->devid); in intel_lpss_remove()
510 lpss->priv_ctx[i] = readl(lpss->priv + i * 4); in intel_lpss_suspend()
517 if (lpss->type != LPSS_DEV_UART) in intel_lpss_suspend()
518 writel(0, lpss->priv + LPSS_PRIV_RESETS); in intel_lpss_suspend()
533 writel(lpss->priv_ctx[i], lpss->priv + i * 4); in intel_lpss_resume()