Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
2
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
98ead6e
Documentation
arch
alpha
arc
arm
boot
common
configs
crypto
include
kernel
kvm
lib
mach-at91
mach-bcm
mach-bcm2835
mach-clps711x
mach-cns3xxx
mach-davinci
mach-dove
mach-ebsa110
mach-ep93xx
mach-exynos
mach-footbridge
mach-gemini
mach-highbank
mach-imx
mach-integrator
mach-iop13xx
mach-iop32x
mach-iop33x
mach-ixp4xx
mach-keystone
mach-kirkwood
mach-ks8695
mach-lpc32xx
mach-mmp
mach-msm
mach-mv78xx0
mach-mvebu
mach-mxs
mach-netx
mach-nomadik
mach-nspire
mach-omap1
mach-omap2
include
Kconfig
Makefile
Makefile.boot
am33xx-restart.c
am33xx.h
am35xx-emac.c
am35xx-emac.h
am35xx.h
board-2430sdp.c
board-3430sdp.c
board-3630sdp.c
board-am3517crane.c
board-am3517evm.c
board-cm-t35.c
board-cm-t3517.c
board-devkit8000.c
board-flash.c
board-flash.h
board-generic.c
board-h4.c
board-igep0020.c
board-ldp.c
board-n8x0.c
board-omap3beagle.c
board-omap3evm.c
board-omap3logic.c
board-omap3pandora.c
board-omap3stalker.c
board-omap3touchbook.c
board-overo.c
board-rm680.c
board-rx51-peripherals.c
board-rx51-video.c
board-rx51.c
board-rx51.h
board-ti8168evm.c
board-zoom-debugboard.c
board-zoom-display.c
board-zoom-peripherals.c
board-zoom.c
board-zoom.h
cclock2420_data.c
cclock2430_data.c
cclock33xx_data.c
cclock3xxx_data.c
cclock44xx_data.c
clkt2xxx_apll.c
clkt2xxx_dpll.c
clkt2xxx_dpllcore.c
clkt2xxx_osc.c
clkt2xxx_sys.c
clkt2xxx_virt_prcm_set.c
clkt34xx_dpll3m2.c
clkt_clksel.c
clkt_dpll.c
clkt_iclk.c
clock.c
clock.h
clock2430.c
clock2xxx.c
clock2xxx.h
clock34xx.c
clock34xx.h
clock3517.c
clock3517.h
clock36xx.c
clock36xx.h
clock3xxx.c
clock3xxx.h
clock44xx.h
clock_common_data.c
clockdomain.c
clockdomain.h
clockdomains2420_data.c
clockdomains2430_data.c
clockdomains2xxx_3xxx_data.c
clockdomains33xx_data.c
clockdomains3xxx_data.c
clockdomains44xx_data.c
clockdomains54xx_data.c
clockdomains7xx_data.c
cm-regbits-24xx.h
cm-regbits-33xx.h
cm-regbits-34xx.h
cm-regbits-44xx.h
cm-regbits-54xx.h
cm-regbits-7xx.h
cm.h
cm1_44xx.h
cm1_54xx.h
cm1_7xx.h
cm2_44xx.h
cm2_54xx.h
cm2_7xx.h
cm2xxx.c
cm2xxx.h
cm2xxx_3xxx.h
cm33xx.c
cm33xx.h
cm3xxx.c
cm3xxx.h
cm44xx.c
cm44xx.h
cm_44xx_54xx.h
cm_common.c
cminst44xx.c
cminst44xx.h
common-board-devices.c
common-board-devices.h
common.c
common.h
control.c
control.h
cpuidle34xx.c
cpuidle44xx.c
ctrl_module_core_44xx.h
ctrl_module_pad_core_44xx.h
ctrl_module_pad_wkup_44xx.h
ctrl_module_wkup_44xx.h
devices.c
devices.h
display.c
display.h
dma.c
dpll3xxx.c
dpll44xx.c
drm.c
dsp.c
dss-common.c
dss-common.h
emu.c
fb.c
gpio.c
gpmc-nand.c
gpmc-nand.h
gpmc-onenand.c
gpmc-onenand.h
gpmc-smc91x.c
gpmc-smc91x.h
gpmc-smsc911x.c
gpmc-smsc911x.h
gpmc.c
gpmc.h
hdq1w.c
hdq1w.h
hsmmc.c
hsmmc.h
hwspinlock.c
i2c.c
i2c.h
id.c
id.h
io.c
iomap.h
irq.c
l3_2xxx.h
l3_3xxx.h
l4_2xxx.h
l4_3xxx.h
mcbsp.c
mmc.h
msdi.c
mux.c
mux.h
mux2420.c
mux2420.h
mux2430.c
mux2430.h
mux34xx.c
mux34xx.h
omap-headsmp.S
omap-hotplug.c
omap-iommu.c
omap-mpuss-lowpower.c
omap-pm-noop.c
omap-pm.h
omap-secure.c
omap-secure.h
omap-smc.S
omap-smp.c
omap-wakeupgen.c
omap-wakeupgen.h
omap2-restart.c
omap24xx.h
omap3-restart.c
omap34xx.h
omap4-common.c
omap4-keypad.h
omap4-restart.c
omap4-sar-layout.h
omap44xx.h
omap54xx.h
omap_device.c
omap_device.h
omap_hwmod.c
omap_hwmod.h
omap_hwmod_2420_data.c
omap_hwmod_2430_data.c
omap_hwmod_2xxx_3xxx_interconnect_data.c
omap_hwmod_2xxx_3xxx_ipblock_data.c
omap_hwmod_2xxx_interconnect_data.c
omap_hwmod_2xxx_ipblock_data.c
omap_hwmod_33xx_data.c
omap_hwmod_3xxx_data.c
omap_hwmod_44xx_data.c
omap_hwmod_54xx_data.c
omap_hwmod_7xx_data.c
omap_hwmod_common_data.c
omap_hwmod_common_data.h
omap_hwmod_reset.c
omap_opp_data.h
omap_phy_internal.c
omap_twl.c
opp.c
opp2420_data.c
opp2430_data.c
opp2xxx.h
opp3xxx_data.c
opp4xxx_data.c
pm-debug.c
pm.c
pm.h
pm24xx.c
pm34xx.c
pm44xx.c
pmu.c
powerdomain-common.c
powerdomain.c
powerdomain.h
powerdomains2xxx_3xxx_data.c
powerdomains2xxx_3xxx_data.h
powerdomains2xxx_data.c
powerdomains33xx_data.c
powerdomains3xxx_data.c
powerdomains44xx_data.c
powerdomains54xx_data.c
powerdomains7xx_data.c
prcm-common.h
prcm44xx.h
prcm_mpu44xx.c
prcm_mpu44xx.h
prcm_mpu54xx.h
prcm_mpu7xx.h
prcm_mpu_44xx_54xx.h
prm-regbits-24xx.h
prm-regbits-33xx.h
prm-regbits-34xx.h
prm-regbits-44xx.h
prm.h
prm2xxx.c
prm2xxx.h
prm2xxx_3xxx.c
prm2xxx_3xxx.h
prm33xx.c
prm33xx.h
prm3xxx.c
prm3xxx.h
prm44xx.c
prm44xx.h
prm44xx_54xx.h
prm54xx.h
prm7xx.h
prm_common.c
prminst44xx.c
prminst44xx.h
scrm44xx.h
scrm54xx.h
sdram-hynix-h8mbx00u0mer-0em.h
sdram-micron-mt46h32m32lf-6.h
sdram-nokia.c
sdram-nokia.h
sdram-numonyx-m65kxxxxam.h
sdram-qimonda-hyb18m512160af-6.h
sdrc.c
sdrc.h
sdrc2xxx.c
serial.c
serial.h
sleep24xx.S
sleep34xx.S
sleep44xx.S
smartreflex-class3.c
soc.h
sr_device.c
sram.c
sram.h
sram242x.S
sram243x.S
sram34xx.S
ti81xx.h
timer.c
twl-common.c
twl-common.h
usb-host.c
usb-musb.c
usb-tusb6010.c
usb.h
vc.c
vc.h
vc3xxx_data.c
vc44xx_data.c
voltage.c
voltage.h
voltagedomains2xxx_data.c
voltagedomains3xxx_data.c
voltagedomains44xx_data.c
voltagedomains54xx_data.c
vp.c
vp.h
vp3xxx_data.c
vp44xx_data.c
wd_timer.c
wd_timer.h
mach-orion5x
mach-picoxcell
mach-prima2
mach-pxa
mach-realview
mach-rockchip
mach-rpc
mach-s3c24xx
mach-s3c64xx
mach-s5p64x0
mach-s5pc100
mach-s5pv210
mach-sa1100
mach-shark
mach-shmobile
mach-socfpga
mach-spear
mach-sti
mach-sunxi
mach-tegra
mach-u300
mach-ux500
mach-versatile
mach-vexpress
mach-virt
mach-vt8500
mach-w90x900
mach-zynq
mm
net
nwfpe
oprofile
plat-iop
plat-omap
plat-orion
plat-pxa
plat-samsung
plat-versatile
tools
vfp
xen
Kconfig
Kconfig-nommu
Kconfig.debug
Makefile
arm64
avr32
blackfin
c6x
cris
frv
h8300
hexagon
ia64
m32r
m68k
metag
microblaze
mips
mn10300
openrisc
parisc
powerpc
s390
score
sh
sparc
tile
um
unicore32
x86
xtensa
.gitignore
Kconfig
block
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt/kvm
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
REPORTING-BUGS
Breadcrumbs
linux
/
arch
/
arm
/
mach-omap2
/
mux.h
Copy path
Blame
Blame
Latest commit
Tony Lindgren
ARM: dts: Fix pinctrl mask for omap3
Oct 8, 2013
d623a0e
·
Oct 8, 2013
History
History
357 lines (312 loc) · 9.76 KB
Breadcrumbs
linux
/
arch
/
arm
/
mach-omap2
/
mux.h
Top
File metadata and controls
Code
Blame
357 lines (312 loc) · 9.76 KB
Raw
/* * Copyright (C) 2009 Nokia * Copyright (C) 2009-2010 Texas Instruments * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include "mux2420.h" #include "mux2430.h" #include "mux34xx.h" #define OMAP_MUX_TERMINATOR 0xffff /* 34xx mux mode options for each pin. See TRM for options */ #define OMAP_MUX_MODE0 0 #define OMAP_MUX_MODE1 1 #define OMAP_MUX_MODE2 2 #define OMAP_MUX_MODE3 3 #define OMAP_MUX_MODE4 4 #define OMAP_MUX_MODE5 5 #define OMAP_MUX_MODE6 6 #define OMAP_MUX_MODE7 7 /* 24xx/34xx mux bit defines */ #define OMAP_PULL_ENA (1 << 3) #define OMAP_PULL_UP (1 << 4) #define OMAP_ALTELECTRICALSEL (1 << 5) /* omap3/4/5 specific mux bit defines */ #define OMAP_INPUT_EN (1 << 8) #define OMAP_OFF_EN (1 << 9) #define OMAP_OFFOUT_EN (1 << 10) #define OMAP_OFFOUT_VAL (1 << 11) #define OMAP_OFF_PULL_EN (1 << 12) #define OMAP_OFF_PULL_UP (1 << 13) #define OMAP_WAKEUP_EN (1 << 14) #define OMAP_WAKEUP_EVENT (1 << 15) /* Active pin states */ #define OMAP_PIN_OUTPUT 0 #define OMAP_PIN_INPUT OMAP_INPUT_EN #define OMAP_PIN_INPUT_PULLUP (OMAP_PULL_ENA | OMAP_INPUT_EN \ | OMAP_PULL_UP) #define OMAP_PIN_INPUT_PULLDOWN (OMAP_PULL_ENA | OMAP_INPUT_EN) /* Off mode states */ #define OMAP_PIN_OFF_NONE 0 #define OMAP_PIN_OFF_OUTPUT_HIGH (OMAP_OFF_EN | OMAP_OFFOUT_EN \ | OMAP_OFFOUT_VAL) #define OMAP_PIN_OFF_OUTPUT_LOW (OMAP_OFF_EN | OMAP_OFFOUT_EN) #define OMAP_PIN_OFF_INPUT_PULLUP (OMAP_OFF_EN | OMAP_OFF_PULL_EN \ | OMAP_OFF_PULL_UP) #define OMAP_PIN_OFF_INPUT_PULLDOWN (OMAP_OFF_EN | OMAP_OFF_PULL_EN) #define OMAP_PIN_OFF_WAKEUPENABLE OMAP_WAKEUP_EN #define OMAP_MODE_GPIO(partition, x) (((x) & OMAP_MUX_MODE7) == \ partition->gpio) #define OMAP_MODE_UART(x) (((x) & OMAP_MUX_MODE7) == OMAP_MUX_MODE0) /* Flags for omapX_mux_init */ #define OMAP_PACKAGE_MASK 0xffff #define OMAP_PACKAGE_CBP 6 /* 515-pin 0.40 0.50 */ #define OMAP_PACKAGE_CUS 5 /* 423-pin 0.65 */ #define OMAP_PACKAGE_CBB 4 /* 515-pin 0.40 0.50 */ #define OMAP_PACKAGE_CBC 3 /* 515-pin 0.50 0.65 */ #define OMAP_PACKAGE_ZAC 2 /* 24xx 447-pin POP */ #define OMAP_PACKAGE_ZAF 1 /* 2420 447-pin SIP */ #define OMAP_MUX_NR_MODES 8 /* Available modes */ #define OMAP_MUX_NR_SIDES 2 /* Bottom & top */ /* * omap_mux_init flags definition: * * OMAP_GPIO_MUX_MODE, bits 0-2: gpio muxing mode, same like pad control * register which includes values from 0-7. * OMAP_MUX_REG_8BIT: Ensure that access to padconf is done in 8 bits. * The default value is 16 bits. */ #define OMAP_MUX_GPIO_IN_MODE0 OMAP_MUX_MODE0 #define OMAP_MUX_GPIO_IN_MODE1 OMAP_MUX_MODE1 #define OMAP_MUX_GPIO_IN_MODE2 OMAP_MUX_MODE2 #define OMAP_MUX_GPIO_IN_MODE3 OMAP_MUX_MODE3 #define OMAP_MUX_GPIO_IN_MODE4 OMAP_MUX_MODE4 #define OMAP_MUX_GPIO_IN_MODE5 OMAP_MUX_MODE5 #define OMAP_MUX_GPIO_IN_MODE6 OMAP_MUX_MODE6 #define OMAP_MUX_GPIO_IN_MODE7 OMAP_MUX_MODE7 #define OMAP_MUX_REG_8BIT (1 << 3) /** * struct omap_board_data - board specific device data * @id: instance id * @flags: additional flags for platform init code * @pads: array of device specific pads * @pads_cnt: ARRAY_SIZE() of pads */ struct omap_board_data { int id; u32 flags; struct omap_device_pad *pads; int pads_cnt; }; /** * struct mux_partition - contain partition related information * @name: name of the current partition * @flags: flags specific to this partition * @gpio: gpio mux mode * @phys: physical address * @size: partition size * @base: virtual address after ioremap * @muxmodes: list of nodes that belong to a partition * @node: list node for the partitions linked list */ struct omap_mux_partition { const char *name; u32 flags; u32 gpio; u32 phys; u32 size; void __iomem *base; struct list_head muxmodes; struct list_head node; }; /** * struct omap_mux - data for omap mux register offset and it's value * @reg_offset: mux register offset from the mux base * @gpio: GPIO number * @muxnames: available signal modes for a ball * @balls: available balls on the package */ struct omap_mux { u16 reg_offset; u16 gpio; #ifdef CONFIG_OMAP_MUX char *muxnames[OMAP_MUX_NR_MODES]; #ifdef CONFIG_DEBUG_FS char *balls[OMAP_MUX_NR_SIDES]; #endif #endif }; /** * struct omap_ball - data for balls on omap package * @reg_offset: mux register offset from the mux base * @balls: available balls on the package */ struct omap_ball { u16 reg_offset; char *balls[OMAP_MUX_NR_SIDES]; }; /** * struct omap_board_mux - data for initializing mux registers * @reg_offset: mux register offset from the mux base * @mux_value: desired mux value to set */ struct omap_board_mux { u16 reg_offset; u16 value; }; #define OMAP_DEVICE_PAD_REMUX BIT(1) /* Dynamically remux a pad, needs enable, idle and off values */ #define OMAP_DEVICE_PAD_WAKEUP BIT(0) /* Pad is wake-up capable */ /** * struct omap_device_pad - device specific pad configuration * @name: signal name * @flags: pad specific runtime flags * @enable: runtime value for a pad * @idle: idle value for a pad * @off: off value for a pad, defaults to safe mode * @partition: mux partition * @mux: mux register */ struct omap_device_pad { char *name; u8 flags; u16 enable; u16 idle; u16 off; struct omap_mux_partition *partition; struct omap_mux *mux; }; struct omap_hwmod_mux_info; #define OMAP_MUX_STATIC(signal, mode) \ { \ .name = (signal), \ .enable = (mode), \ } #if defined(CONFIG_OMAP_MUX) /** * omap_mux_init_gpio - initialize a signal based on the GPIO number * @gpio: GPIO number * @val: Options for the mux register value */ int omap_mux_init_gpio(int gpio, int val); /** * omap_mux_init_signal - initialize a signal based on the signal name * @muxname: Mux name in mode0_name.signal_name format * @val: Options for the mux register value */ int omap_mux_init_signal(const char *muxname, int val); /** * omap_hwmod_mux_init - initialize hwmod specific mux data * @bpads: Board specific device signal names * @nr_pads: Number of signal names for the device */ extern struct omap_hwmod_mux_info * omap_hwmod_mux_init(struct omap_device_pad *bpads, int nr_pads); /** * omap_hwmod_mux - omap hwmod specific pin muxing * @hmux: Pads for a hwmod * @state: Desired _HWMOD_STATE * * Called only from omap_hwmod.c, do not use. */ void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state); int omap_mux_get_by_name(const char *muxname, struct omap_mux_partition **found_partition, struct omap_mux **found_mux); #else static inline int omap_mux_get_by_name(const char *muxname, struct omap_mux_partition **found_partition, struct omap_mux **found_mux) { return 0; } static inline int omap_mux_init_gpio(int gpio, int val) { return 0; } static inline int omap_mux_init_signal(char *muxname, int val) { return 0; } static inline struct omap_hwmod_mux_info * omap_hwmod_mux_init(struct omap_device_pad *bpads, int nr_pads) { return NULL; } static inline void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state) { } static struct omap_board_mux *board_mux __maybe_unused; #endif /** * omap_mux_get_gpio() - get mux register value based on GPIO number * @gpio: GPIO number * */ u16 omap_mux_get_gpio(int gpio); /** * omap_mux_set_gpio() - set mux register value based on GPIO number * @val: New mux register value * @gpio: GPIO number * */ void omap_mux_set_gpio(u16 val, int gpio); /** * omap_mux_get() - get a mux partition by name * @name: Name of the mux partition * */ struct omap_mux_partition *omap_mux_get(const char *name); /** * omap_mux_read() - read mux register * @partition: Mux partition * @mux_offset: Offset of the mux register * */ u16 omap_mux_read(struct omap_mux_partition *p, u16 mux_offset); /** * omap_mux_write() - write mux register * @partition: Mux partition * @val: New mux register value * @mux_offset: Offset of the mux register * * This should be only needed for dynamic remuxing of non-gpio signals. */ void omap_mux_write(struct omap_mux_partition *p, u16 val, u16 mux_offset); /** * omap_mux_write_array() - write an array of mux registers * @partition: Mux partition * @board_mux: Array of mux registers terminated by MAP_MUX_TERMINATOR * * This should be only needed for dynamic remuxing of non-gpio signals. */ void omap_mux_write_array(struct omap_mux_partition *p, struct omap_board_mux *board_mux); /** * omap2420_mux_init() - initialize mux system with board specific set * @board_mux: Board specific mux table * @flags: OMAP package type used for the board */ int omap2420_mux_init(struct omap_board_mux *board_mux, int flags); /** * omap2430_mux_init() - initialize mux system with board specific set * @board_mux: Board specific mux table * @flags: OMAP package type used for the board */ int omap2430_mux_init(struct omap_board_mux *board_mux, int flags); /** * omap3_mux_init() - initialize mux system with board specific set * @board_mux: Board specific mux table * @flags: OMAP package type used for the board */ int omap3_mux_init(struct omap_board_mux *board_mux, int flags); /** * omap4_mux_init() - initialize mux system with board specific set * @board_subset: Board specific mux table * @board_wkup_subset: Board specific mux table for wakeup instance * @flags: OMAP package type used for the board */ int omap4_mux_init(struct omap_board_mux *board_subset, struct omap_board_mux *board_wkup_subset, int flags); /** * omap_mux_init - private mux init function, do not call */ int omap_mux_init(const char *name, u32 flags, u32 mux_pbase, u32 mux_size, struct omap_mux *superset, struct omap_mux *package_subset, struct omap_board_mux *board_mux, struct omap_ball *package_balls);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
You can’t perform that action at this time.