Lines Matching +full:dma +full:- +full:mem
1 // SPDX-License-Identifier: GPL-2.0
3 * support.c - standard functions for the use of pnp protocol drivers
6 * Copyright (C) 2008 Hewlett-Packard Development Company, L.P.
16 * pnp_is_active - Determines if a device is active based on its current
24 * only clears out auto-assigned resources. in pnp_is_active()
28 pnp_irq(dev, 0) == -1 && pnp_dma(dev, 0) == -1) in pnp_is_active()
44 * According to the specs, the first three characters are five-bit in pnp_eisa_id_to_string()
45 * compressed ASCII, and the left-over high order bit should be zero. in pnp_eisa_id_to_string()
51 str[0] = 'A' + ((id >> 26) & 0x3f) - 1; in pnp_eisa_id_to_string()
52 str[1] = 'A' + ((id >> 21) & 0x1f) - 1; in pnp_eisa_id_to_string()
53 str[2] = 'A' + ((id >> 16) & 0x1f) - 1; in pnp_eisa_id_to_string()
67 return "mem"; in pnp_resource_type_name()
71 return "dma"; in pnp_resource_type_name()
82 if (list_empty(&dev->resources)) in dbg_pnp_show_resources()
83 pnp_dbg(&dev->dev, "%s: no current resources\n", desc); in dbg_pnp_show_resources()
85 pnp_dbg(&dev->dev, "%s: current resources:\n", desc); in dbg_pnp_show_resources()
86 list_for_each_entry(pnp_res, &dev->resources, list) in dbg_pnp_show_resources()
87 pnp_dbg(&dev->dev, "%pr\n", &pnp_res->res); in dbg_pnp_show_resources()
109 struct pnp_mem *mem; in dbg_pnp_show_option() local
111 struct pnp_dma *dma; in dbg_pnp_show_option() local
114 len += scnprintf(buf + len, sizeof(buf) - len, in dbg_pnp_show_option()
119 len += scnprintf(buf + len, sizeof(buf) - len, in dbg_pnp_show_option()
122 switch (option->type) { in dbg_pnp_show_option()
124 port = &option->u.port; in dbg_pnp_show_option()
125 len += scnprintf(buf + len, sizeof(buf) - len, "io min %#llx " in dbg_pnp_show_option()
127 (unsigned long long) port->min, in dbg_pnp_show_option()
128 (unsigned long long) port->max, in dbg_pnp_show_option()
129 (unsigned long long) port->align, in dbg_pnp_show_option()
130 (unsigned long long) port->size, port->flags); in dbg_pnp_show_option()
133 mem = &option->u.mem; in dbg_pnp_show_option()
134 len += scnprintf(buf + len, sizeof(buf) - len, "mem min %#llx " in dbg_pnp_show_option()
136 (unsigned long long) mem->min, in dbg_pnp_show_option()
137 (unsigned long long) mem->max, in dbg_pnp_show_option()
138 (unsigned long long) mem->align, in dbg_pnp_show_option()
139 (unsigned long long) mem->size, mem->flags); in dbg_pnp_show_option()
142 irq = &option->u.irq; in dbg_pnp_show_option()
143 len += scnprintf(buf + len, sizeof(buf) - len, "irq"); in dbg_pnp_show_option()
144 if (bitmap_empty(irq->map.bits, PNP_IRQ_NR)) in dbg_pnp_show_option()
145 len += scnprintf(buf + len, sizeof(buf) - len, in dbg_pnp_show_option()
149 if (test_bit(i, irq->map.bits)) in dbg_pnp_show_option()
151 sizeof(buf) - len, in dbg_pnp_show_option()
154 len += scnprintf(buf + len, sizeof(buf) - len, " flags %#x", in dbg_pnp_show_option()
155 irq->flags); in dbg_pnp_show_option()
156 if (irq->flags & IORESOURCE_IRQ_OPTIONAL) in dbg_pnp_show_option()
157 len += scnprintf(buf + len, sizeof(buf) - len, in dbg_pnp_show_option()
161 dma = &option->u.dma; in dbg_pnp_show_option()
162 len += scnprintf(buf + len, sizeof(buf) - len, "dma"); in dbg_pnp_show_option()
163 if (!dma->map) in dbg_pnp_show_option()
164 len += scnprintf(buf + len, sizeof(buf) - len, in dbg_pnp_show_option()
168 if (dma->map & (1 << i)) in dbg_pnp_show_option()
170 sizeof(buf) - len, in dbg_pnp_show_option()
173 len += scnprintf(buf + len, sizeof(buf) - len, " (bitmask %#x) " in dbg_pnp_show_option()
174 "flags %#x", dma->map, dma->flags); in dbg_pnp_show_option()
177 pnp_dbg(&dev->dev, "%s\n", buf); in dbg_pnp_show_option()