Lines Matching +full:omap +full:- +full:usb2

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * linux/arch/arm/mach-omap1/mux.c
7 * Copyright (C) 2003 - 2008 Nokia Corporation
15 #include <linux/soc/ti/omap1-io.h>
33 /* UART2 (COM_UART_GATING), conflicts with USB2 */
74 /* USB2 master */
83 /* OMAP-1510 GPIO */
92 /* OMAP-1710 GPIO */
129 /* OMAP-1610 MMC2 */
141 /* OMAP-1610 External Trace Interface */
164 /* OMAP-1610 uWire */
172 /* OMAP-1610 SPI */
183 /* OMAP-1610 Flash */
198 /* OMAP-1610 USB0 alternate configuration */
208 /* USB2 interface */
295 if (cfg->mux_reg) { in omap1_cfg_reg()
299 reg_orig = omap_readl(cfg->mux_reg); in omap1_cfg_reg()
302 mask = (0x7 << cfg->mask_offset); in omap1_cfg_reg()
306 tmp2 = (cfg->mask << cfg->mask_offset); in omap1_cfg_reg()
312 omap_writel(reg, cfg->mux_reg); in omap1_cfg_reg()
318 if (cfg->pu_pd_reg && cfg->pull_val) { in omap1_cfg_reg()
320 pu_pd_orig = omap_readl(cfg->pu_pd_reg); in omap1_cfg_reg()
321 mask = 1 << cfg->pull_bit; in omap1_cfg_reg()
323 if (cfg->pu_pd_val) { in omap1_cfg_reg()
334 omap_writel(pu_pd, cfg->pu_pd_reg); in omap1_cfg_reg()
340 if (cfg->pull_reg) { in omap1_cfg_reg()
342 pull_orig = omap_readl(cfg->pull_reg); in omap1_cfg_reg()
343 mask = 1 << cfg->pull_bit; in omap1_cfg_reg()
345 if (cfg->pull_val) { in omap1_cfg_reg()
357 omap_writel(pull, cfg->pull_reg); in omap1_cfg_reg()
363 printk(KERN_WARNING "MUX: initialized %s\n", cfg->name); in omap1_cfg_reg()
368 if (cfg->debug || warn) { in omap1_cfg_reg()
369 printk("MUX: Setting register %s\n", cfg->name); in omap1_cfg_reg()
370 printk(" %s (0x%08x) = 0x%08x -> 0x%08x\n", in omap1_cfg_reg()
371 cfg->mux_reg_name, cfg->mux_reg, reg_orig, reg); in omap1_cfg_reg()
374 if (cfg->pu_pd_reg && cfg->pull_val) { in omap1_cfg_reg()
375 printk(" %s (0x%08x) = 0x%08x -> 0x%08x\n", in omap1_cfg_reg()
376 cfg->pu_pd_name, cfg->pu_pd_reg, in omap1_cfg_reg()
381 if (cfg->pull_reg) in omap1_cfg_reg()
382 printk(" %s (0x%08x) = 0x%08x -> 0x%08x\n", in omap1_cfg_reg()
383 cfg->pull_name, cfg->pull_reg, pull_orig, pull); in omap1_cfg_reg()
388 return warn ? -ETXTBSY : 0; in omap1_cfg_reg()
398 if (!arch_mux_cfg || !arch_mux_cfg->pins || arch_mux_cfg->size == 0 in omap_mux_register()
399 || !arch_mux_cfg->cfg_reg) { in omap_mux_register()
401 return -EINVAL; in omap_mux_register()
410 * Sets the Omap MUX and PULL_DWN registers based on the table
420 return -EINVAL; in omap_cfg_reg()
425 return -ENODEV; in omap_cfg_reg()
428 if (index >= mux_cfg->size) { in omap_cfg_reg()
430 index, mux_cfg->size); in omap_cfg_reg()
432 return -ENODEV; in omap_cfg_reg()
435 reg = &mux_cfg->pins[index]; in omap_cfg_reg()
437 if (!mux_cfg->cfg_reg) in omap_cfg_reg()
438 return -ENODEV; in omap_cfg_reg()
440 return mux_cfg->cfg_reg(reg); in omap_cfg_reg()