Lines Matching +full:clkout +full:- +full:fmt

1 // SPDX-License-Identifier: GPL-2.0-only
9 * Bosch CC770 and Intel AN82527 CAN controllers on the ISA or PC-104 bus.
32 * Note: for clk, cir, bcr and cor, the first argument re-defines the
42 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt argument
61 MODULE_DESCRIPTION("Socket-CAN driver for CC770 on the ISA bus");
72 static u8 cir[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};
73 static u8 cor[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};
74 static u8 bcr[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};
75 static int indirect[MAXDEV] = {[0 ... (MAXDEV - 1)] = -1};
114 return readb(priv->reg_base + reg); in cc770_isa_mem_read_reg()
120 writeb(val, priv->reg_base + reg); in cc770_isa_mem_write_reg()
125 return inb((unsigned long)priv->reg_base + reg); in cc770_isa_port_read_reg()
131 outb(val, (unsigned long)priv->reg_base + reg); in cc770_isa_port_write_reg()
137 unsigned long base = (unsigned long)priv->reg_base; in cc770_isa_port_read_reg_indirect()
152 unsigned long base = (unsigned long)priv->reg_base; in cc770_isa_port_write_reg_indirect()
167 int idx = pdev->id; in cc770_isa_probe()
171 dev_dbg(&pdev->dev, "probing idx=%d: port=%#lx, mem=%#lx, irq=%d\n", in cc770_isa_probe()
175 err = -EBUSY; in cc770_isa_probe()
180 err = -ENOMEM; in cc770_isa_probe()
185 (indirect[idx] == -1 && indirect[0] > 0)) in cc770_isa_probe()
188 err = -EBUSY; in cc770_isa_probe()
195 err = -ENOMEM; in cc770_isa_probe()
200 dev->irq = irq[idx]; in cc770_isa_probe()
201 priv->irq_flags = IRQF_SHARED; in cc770_isa_probe()
203 priv->reg_base = base; in cc770_isa_probe()
204 dev->base_addr = mem[idx]; in cc770_isa_probe()
205 priv->read_reg = cc770_isa_mem_read_reg; in cc770_isa_probe()
206 priv->write_reg = cc770_isa_mem_write_reg; in cc770_isa_probe()
208 priv->reg_base = (void __iomem *)port[idx]; in cc770_isa_probe()
209 dev->base_addr = port[idx]; in cc770_isa_probe()
212 priv->read_reg = cc770_isa_port_read_reg_indirect; in cc770_isa_probe()
213 priv->write_reg = cc770_isa_port_write_reg_indirect; in cc770_isa_probe()
215 priv->read_reg = cc770_isa_port_read_reg; in cc770_isa_probe()
216 priv->write_reg = cc770_isa_port_write_reg; in cc770_isa_probe()
226 priv->can.clock.freq = clktmp; in cc770_isa_probe()
229 priv->cpu_interface = cir[idx]; in cc770_isa_probe()
231 priv->cpu_interface = cir[0]; in cc770_isa_probe()
235 priv->cpu_interface |= CPUIF_DSC; in cc770_isa_probe()
240 priv->cpu_interface |= CPUIF_DMC; in cc770_isa_probe()
243 if (priv->cpu_interface & CPUIF_DSC) in cc770_isa_probe()
244 priv->can.clock.freq /= 2; in cc770_isa_probe()
247 priv->bus_config = bcr[idx]; in cc770_isa_probe()
249 priv->bus_config = bcr[0]; in cc770_isa_probe()
251 priv->bus_config = BCR_DEFAULT; in cc770_isa_probe()
254 priv->clkout = cor[idx]; in cc770_isa_probe()
256 priv->clkout = cor[0]; in cc770_isa_probe()
258 priv->clkout = COR_DEFAULT; in cc770_isa_probe()
261 SET_NETDEV_DEV(dev, &pdev->dev); in cc770_isa_probe()
265 dev_err(&pdev->dev, in cc770_isa_probe()
270 dev_info(&pdev->dev, "device registered (reg_base=0x%p, irq=%d)\n", in cc770_isa_probe()
271 priv->reg_base, dev->irq); in cc770_isa_probe()
292 int idx = pdev->id; in cc770_isa_remove()
297 iounmap(priv->reg_base); in cc770_isa_remove()
300 if (priv->read_reg == cc770_isa_port_read_reg_indirect) in cc770_isa_remove()
325 err = -ENOMEM; in cc770_isa_init()
338 err = -EINVAL; in cc770_isa_init()
352 while (--idx >= 0) { in cc770_isa_init()