/* * linux/arch/arm/lib/findbit.S * * Copyright (C) 1995-2000 Russell King * * 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. * * 16th March 2001 - John Ripley * Fixed so that "size" is an exclusive not an inclusive quantity. * All users of these functions expect exclusive sizes, and may * also call with zero size. * Reworked by rmk. */ #include #include .text /* * Purpose : Find a 'zero' bit * Prototype: int find_first_zero_bit(void *addr, unsigned int maxbit); */ ENTRY(_find_first_zero_bit_le) teq r1, #0 beq 3f mov r2, #0 1: ARM( ldrb r3, [r0, r2, lsr #3] ) THUMB( lsr r3, r2, #3 ) THUMB( ldrb r3, [r0, r3] ) eors r3, r3, #0xff @ invert bits bne .L_found @ any now set - found zero bit add r2, r2, #8 @ next bit pointer 2: cmp r2, r1 @ any more? blo 1b 3: mov r0, r1 @ no free bits mov pc, lr ENDPROC(_find_first_zero_bit_le) /* * Purpose : Find next 'zero' bit * Prototype: int find_next_zero_bit(void *addr, unsigned int maxbit, int offset) */ ENTRY(_find_next_zero_bit_le) teq r1, #0 beq 3b ands ip, r2, #7 beq 1b @ If new byte, goto old routine ARM( ldrb r3, [r0, r2, lsr #3] ) THUMB( lsr r3, r2, #3 ) THUMB( ldrb r3, [r0, r3] ) eor r3, r3, #0xff @ now looking for a 1 bit movs r3, r3, lsr ip @ shift off unused bits bne .L_found orr r2, r2, #7 @ if zero, then no bits here add r2, r2, #1 @ align bit pointer b 2b @ loop for next bit ENDPROC(_find_next_zero_bit_le) /* * Purpose : Find a 'one' bit * Prototype: int find_first_bit(const unsigned long *addr, unsigned int maxbit); */ ENTRY(_find_first_bit_le) teq r1, #0 beq 3f mov r2, #0 1: ARM( ldrb r3, [r0, r2, lsr #3] ) THUMB( lsr r3, r2, #3 ) THUMB( ldrb r3, [r0, r3] ) movs r3, r3 bne .L_found @ any now set - found zero bit add r2, r2, #8 @ next bit pointer 2: cmp r2, r1 @ any more? blo 1b 3: mov r0, r1 @ no free bits mov pc, lr ENDPROC(_find_first_bit_le) /* * Purpose : Find next 'one' bit * Prototype: int find_next_zero_bit(void *addr, unsigned int maxbit, int offset) */ ENTRY(_find_next_bit_le) teq r1, #0 beq 3b ands ip, r2, #7 beq 1b @ If new byte, goto old routine ARM( ldrb r3, [r0, r2, lsr #3] ) THUMB( lsr r3, r2, #3 ) THUMB( ldrb r3, [r0, r3] ) movs r3, r3, lsr ip @ shift off unused bits bne .L_found orr r2, r2, #7 @ if zero, then no bits here add r2, r2, #1 @ align bit pointer b 2b @ loop for next bit ENDPROC(_find_next_bit_le) #ifdef __ARMEB__ ENTRY(_find_first_zero_bit_be) teq r1, #0 beq 3f mov r2, #0 1: eor r3, r2, #0x18 @ big endian byte ordering ARM( ldrb r3, [r0, r3, lsr #3] ) THUMB( lsr r3, #3 ) THUMB( ldrb r3, [r0, r3] ) eors r3, r3, #0xff @ invert bits bne .L_found @ any now set - found zero bit add r2, r2, #8 @ next bit pointer 2: cmp r2, r1 @ any more? blo 1b 3: mov r0, r1 @ no free bits mov pc, lr ENDPROC(_find_first_zero_bit_be) ENTRY(_find_next_zero_bit_be) teq r1, #0 beq 3b ands ip, r2, #7 beq 1b @ If new byte, goto old routine eor r3, r2, #0x18 @ big endian byte ordering ARM( ldrb r3, [r0, r3, lsr #3] ) THUMB( lsr r3, #3 ) THUMB( ldrb r3, [r0, r3] ) eor r3, r3, #0xff @ now looking for a 1 bit movs r3, r3, lsr ip @ shift off unused bits bne .L_found orr r2, r2, #7 @ if zero, then no bits here add r2, r2, #1 @ align bit pointer b 2b @ loop for next bit ENDPROC(_find_next_zero_bit_be) ENTRY(_find_first_bit_be) teq r1, #0 beq 3f mov r2, #0 1: eor r3, r2, #0x18 @ big endian byte ordering ARM( ldrb r3, [r0, r3, lsr #3] ) THUMB( lsr r3, #3 ) THUMB( ldrb r3, [r0, r3] ) movs r3, r3 bne .L_found @ any now set - found zero bit add r2, r2, #8 @ next bit pointer 2: cmp r2, r1 @ any more? blo 1b 3: mov r0, r1 @ no free bits mov pc, lr ENDPROC(_find_first_bit_be) ENTRY(_find_next_bit_be) teq r1, #0 beq 3b ands ip, r2, #7 beq 1b @ If new byte, goto old routine eor r3, r2, #0x18 @ big endian byte ordering ARM( ldrb r3, [r0, r3, lsr #3] ) THUMB( lsr r3, #3 ) THUMB( ldrb r3, [r0, r3] ) movs r3, r3, lsr ip @ shift off unused bits bne .L_found orr r2, r2, #7 @ if zero, then no bits here add r2, r2, #1 @ align bit pointer b 2b @ loop for next bit ENDPROC(_find_next_bit_be) #endif /* * One or more bits in the LSB of r3 are assumed to be set. */ .L_found: #if __LINUX_ARM_ARCH__ >= 5 rsb r1, r3, #0 and r3, r3, r1 clz r3, r3 rsb r3, r3, #31 add r0, r2, r3 #else tst r3, #0x0f addeq r2, r2, #4 movne r3, r3, lsl #4 tst r3, #0x30 addeq r2, r2, #2 movne r3, r3, lsl #2 tst r3, #0x40 addeq r2, r2, #1 mov r0, r2 #endif mov pc, lr ' href='#n13'>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 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266
#
# Multifunction miscellaneous devices
#

menu "Multifunction device drivers"
	depends on HAS_IOMEM

config MFD_CORE
	tristate
	default n

config MFD_SM501
	tristate "Support for Silicon Motion SM501"
	 ---help---
	  This is the core driver for the Silicon Motion SM501 multimedia
	  companion chip. This device is a multifunction device which may
	  provide numerous interfaces including USB host controller, USB gadget,
	  asynchronous serial ports, audio functions, and a dual display video
	  interface. The device may be connected by PCI or local bus with
	  varying functions enabled.

config MFD_SM501_GPIO
	bool "Export GPIO via GPIO layer"
	depends on MFD_SM501 && GPIOLIB
	 ---help---
	 This option uses the gpio library layer to export the 64 GPIO
	 lines on the SM501. The platform data is used to supply the
	 base number for the first GPIO line to register.

config MFD_ASIC3
	bool "Support for Compaq ASIC3"
	depends on GENERIC_HARDIRQS && GPIOLIB && ARM
	 ---help---
	  This driver supports the ASIC3 multifunction chip found on many
	  PDAs (mainly iPAQ and HTC based ones)

config MFD_DM355EVM_MSP
	bool "DaVinci DM355 EVM microcontroller"
	depends on I2C && MACH_DAVINCI_DM355_EVM
	help
	  This driver supports the MSP430 microcontroller used on these
	  boards.  MSP430 firmware manages resets and power sequencing,
	  inputs from buttons and the IR remote, LEDs, an RTC, and more.

config HTC_EGPIO
	bool "HTC EGPIO support"
	depends on GENERIC_HARDIRQS && GPIOLIB && ARM
	help
	    This driver supports the CPLD egpio chip present on
	    several HTC phones.  It provides basic support for input
	    pins, output pins, and irqs.

config HTC_PASIC3
	tristate "HTC PASIC3 LED/DS1WM chip support"
	help
	  This core driver provides register access for the LED/DS1WM
	  chips labeled "AIC2" and "AIC3", found on HTC Blueangel and
	  HTC Magician devices, respectively. Actual functionality is
	  handled by the leds-pasic3 and ds1wm drivers.

config UCB1400_CORE
	tristate "Philips UCB1400 Core driver"
	depends on AC97_BUS
	depends on GPIOLIB
	help
	  This enables support for the Philips UCB1400 core functions.
	  The UCB1400 is an AC97 audio codec.

	  To compile this driver as a module, choose M here: the
	  module will be called ucb1400_core.

config TPS65010
	tristate "TPS6501x Power Management chips"
	depends on I2C && GPIOLIB
	default y if MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_OSK
	help
	  If you say yes here you get support for the TPS6501x series of
	  Power Management chips.  These include voltage regulators,
	  lithium ion/polymer battery charging, and other features that
	  are often used in portable devices like cell phones and cameras.

	  This driver can also be built as a module.  If so, the module
	  will be called tps65010.

config MENELAUS
	bool "Texas Instruments TWL92330/Menelaus PM chip"
	depends on I2C=y && ARCH_OMAP24XX
	help
	  If you say yes here you get support for the Texas Instruments
	  TWL92330/Menelaus Power Management chip. This include voltage
	  regulators, Dual slot memory card tranceivers, real-time clock
	  and other features that are often used in portable devices like
	  cell phones and PDAs.

config TWL4030_CORE
	bool "Texas Instruments TWL4030/TPS659x0 Support"
	depends on I2C=y && GENERIC_HARDIRQS
	help
	  Say yes here if you have TWL4030 family chip on your board.
	  This core driver provides register access and IRQ handling
	  facilities, and registers devices for the various functions
	  so that function-specific drivers can bind to them.

	  These multi-function chips are found on many OMAP2 and OMAP3
	  boards, providing power management, RTC, GPIO, keypad, a
	  high speed USB OTG transceiver, an audio codec (on most
	  versions) and many other features.

config MFD_TMIO
	bool
	default n

config MFD_T7L66XB
	bool "Support Toshiba T7L66XB"
	depends on ARM && HAVE_CLK
	select MFD_CORE
	select MFD_TMIO
	help
	  Support for Toshiba Mobile IO Controller T7L66XB

config MFD_TC6387XB
	bool "Support Toshiba TC6387XB"
	depends on ARM && HAVE_CLK
	select MFD_CORE
	select MFD_TMIO
	help
	  Support for Toshiba Mobile IO Controller TC6387XB

config MFD_TC6393XB
	bool "Support Toshiba TC6393XB"
	depends on GPIOLIB && ARM
	select MFD_CORE
	select MFD_TMIO
	help
	  Support for Toshiba Mobile IO Controller TC6393XB

config PMIC_DA903X
	bool "Dialog Semiconductor DA9030/DA9034 PMIC Support"
	depends on I2C=y
	help
	  Say yes here to support for Dialog Semiconductor DA9030 (a.k.a
	  ARAVA) and DA9034 (a.k.a MICCO), these are Power Management IC
	  usually found on PXA processors-based platforms. This includes
	  the I2C driver and the core APIs _only_, you have to select
	  individual components like LCD backlight, voltage regulators,
	  LEDs and battery-charger under the corresponding menus.

config MFD_WM8400
	tristate "Support Wolfson Microelectronics WM8400"
	select MFD_CORE
	depends on I2C
	help
	  Support for the Wolfson Microelecronics WM8400 PMIC and audio
	  CODEC.  This driver adds provides common support for accessing
	  the device, additional drivers must be enabled in order to use
	  the functionality of the device.

config MFD_WM8350
	tristate

config MFD_WM8350_CONFIG_MODE_0
	bool
	depends on MFD_WM8350

config MFD_WM8350_CONFIG_MODE_1
	bool
	depends on MFD_WM8350

config MFD_WM8350_CONFIG_MODE_2
	bool
	depends on MFD_WM8350

config MFD_WM8350_CONFIG_MODE_3
	bool
	depends on MFD_WM8350

config MFD_WM8351_CONFIG_MODE_0
	bool
	depends on MFD_WM8350

config MFD_WM8351_CONFIG_MODE_1
	bool
	depends on MFD_WM8350

config MFD_WM8351_CONFIG_MODE_2
	bool
	depends on MFD_WM8350

config MFD_WM8351_CONFIG_MODE_3
	bool
	depends on MFD_WM8350

config MFD_WM8352_CONFIG_MODE_0
	bool
	depends on MFD_WM8350

config MFD_WM8352_CONFIG_MODE_1
	bool
	depends on MFD_WM8350

config MFD_WM8352_CONFIG_MODE_2
	bool
	depends on MFD_WM8350

config MFD_WM8352_CONFIG_MODE_3
	bool
	depends on MFD_WM8350

config MFD_WM8350_I2C
	tristate "Support Wolfson Microelectronics WM8350 with I2C"
	select MFD_WM8350
	depends on I2C
	help
	  The WM8350 is an integrated audio and power management
	  subsystem with watchdog and RTC functionality for embedded
	  systems.  This option enables core support for the WM8350 with
	  I2C as the control interface.  Additional options must be
	  selected to enable support for the functionality of the chip.

config MFD_PCF50633
	tristate "Support for NXP PCF50633"
	depends on I2C
	help
	  Say yes here if you have NXP PCF50633 chip on your board.
	  This core driver provides register access and IRQ handling
	  facilities, and registers devices for the various functions
	  so that function-specific drivers can bind to them.

config PCF50633_ADC
	tristate "Support for NXP PCF50633 ADC"
	depends on MFD_PCF50633
	help
	 Say yes here if you want to include support for ADC in the
	 NXP PCF50633 chip.

config PCF50633_GPIO
	tristate "Support for NXP PCF50633 GPIO"
	depends on MFD_PCF50633
	help
	 Say yes here if you want to include support GPIO for pins on
	 the PCF50633 chip.

endmenu

menu "Multimedia Capabilities Port drivers"
	depends on ARCH_SA1100

config MCP
	tristate

# Interface drivers
config MCP_SA11X0
	tristate "Support SA11x0 MCP interface"
	depends on ARCH_SA1100
	select MCP