Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: pxa: remove Intel Imote2 and Stargate 2 boards

I have no reason to believe these boards have any more users and I
haven't tested them for several years. Removing them may simplify
other changes to the various PXA boards people still care about.
The recent conversion of pxa2xx_spi to GPIO descriptors for example
had to update this board despite no one caring or testing.

Great boards that got me started in kernel development, RIP!

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Daniel Mack <daniel@zonque.org>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: soc@kernel.org
Link: https://lore.kernel.org/r/20220227134431.908998-1-jic23@kernel.org'
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

authored by

Jonathan Cameron and committed by
Arnd Bergmann
28f74201 4036b29a

+2 -1303
-7
MAINTAINERS
··· 2116 2116 F: arch/arm64/boot/dts/intel/keembay-evm.dts 2117 2117 F: arch/arm64/boot/dts/intel/keembay-soc.dtsi 2118 2118 2119 - ARM/INTEL RESEARCH IMOTE/STARGATE 2 MACHINE SUPPORT 2120 - M: Jonathan Cameron <jic23@cam.ac.uk> 2121 - L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 2122 - S: Maintained 2123 - F: arch/arm/mach-pxa/stargate2.c 2124 - F: drivers/pcmcia/pxa2xx_stargate2.c 2125 - 2126 2119 ARM/INTEL XSC3 (MANZANO) ARM CORE 2127 2120 M: Lennert Buytenhek <kernel@wantstofly.org> 2128 2121 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
-3
arch/arm/configs/pxa_defconfig
··· 41 41 CONFIG_MACH_CM_X300=y 42 42 CONFIG_MACH_CAPC7117=y 43 43 CONFIG_ARCH_GUMSTIX=y 44 - CONFIG_MACH_INTELMOTE2=y 45 - CONFIG_MACH_STARGATE2=y 46 44 CONFIG_MACH_XCEP=y 47 45 CONFIG_TRIZEPS_PXA=y 48 46 CONFIG_MACH_TRIZEPS4WL=y ··· 485 487 CONFIG_SND_PXA2XX_SOC_HX4700=m 486 488 CONFIG_SND_PXA2XX_SOC_MAGICIAN=m 487 489 CONFIG_SND_PXA2XX_SOC_MIOA701=m 488 - CONFIG_SND_PXA2XX_SOC_IMOTE2=m 489 490 CONFIG_SND_SOC_AK4642=m 490 491 CONFIG_SND_SOC_WM8978=m 491 492 CONFIG_SND_SIMPLE_CARD=m
-10
arch/arm/mach-pxa/Kconfig
··· 153 153 154 154 endchoice 155 155 156 - config MACH_INTELMOTE2 157 - bool "Intel Mote 2 Platform" 158 - select IWMMXT 159 - select PXA27x 160 - 161 - config MACH_STARGATE2 162 - bool "Intel Stargate 2 Platform" 163 - select IWMMXT 164 - select PXA27x 165 - 166 156 config MACH_XCEP 167 157 bool "Iskratel Electronics XCEP" 168 158 select MTD
-2
arch/arm/mach-pxa/Makefile
··· 45 45 obj-$(CONFIG_ARCH_GUMSTIX) += gumstix.o 46 46 obj-$(CONFIG_GUMSTIX_AM200EPD) += am200epd.o 47 47 obj-$(CONFIG_GUMSTIX_AM300EPD) += am300epd.o 48 - obj-$(CONFIG_MACH_INTELMOTE2) += stargate2.o 49 - obj-$(CONFIG_MACH_STARGATE2) += stargate2.o 50 48 obj-$(CONFIG_MACH_XCEP) += xcep.o 51 49 obj-$(CONFIG_MACH_TRIZEPS4) += trizeps4.o 52 50 obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o
+1 -2
arch/arm/mach-pxa/include/mach/uncompress.h
··· 58 58 uart_shift = 2; 59 59 uart_is_pxa = 1; 60 60 61 - if (machine_is_littleton() || machine_is_intelmote2() 62 - || machine_is_csb726() || machine_is_stargate2() 61 + if (machine_is_littleton() || machine_is_csb726() || 63 62 || machine_is_cm_x300() || machine_is_balloon3()) 64 63 uart_base = STUART_BASE; 65 64
-1030
arch/arm/mach-pxa/stargate2.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * linux/arch/arm/mach-pxa/stargate2.c 4 - * 5 - * Author: Ed C. Epp 6 - * Created: Nov 05, 2002 7 - * Copyright: Intel Corp. 8 - * 9 - * Modified 2009: Jonathan Cameron <jic23@cam.ac.uk> 10 - */ 11 - 12 - #include <linux/init.h> 13 - #include <linux/device.h> 14 - #include <linux/interrupt.h> 15 - #include <linux/sched.h> 16 - #include <linux/bitops.h> 17 - #include <linux/fb.h> 18 - #include <linux/delay.h> 19 - #include <linux/platform_device.h> 20 - #include <linux/regulator/machine.h> 21 - #include <linux/mtd/mtd.h> 22 - #include <linux/mtd/plat-ram.h> 23 - #include <linux/mtd/partitions.h> 24 - 25 - #include <linux/platform_data/i2c-pxa.h> 26 - #include <linux/platform_data/pcf857x.h> 27 - #include <linux/smc91x.h> 28 - #include <linux/gpio/machine.h> 29 - #include <linux/gpio.h> 30 - #include <linux/leds.h> 31 - #include <linux/property.h> 32 - 33 - #include <asm/types.h> 34 - #include <asm/setup.h> 35 - #include <asm/memory.h> 36 - #include <asm/mach-types.h> 37 - #include <asm/irq.h> 38 - 39 - #include <asm/mach/arch.h> 40 - #include <asm/mach/map.h> 41 - #include <asm/mach/irq.h> 42 - #include <asm/mach/flash.h> 43 - 44 - #include "pxa27x.h" 45 - #include <linux/platform_data/mmc-pxamci.h> 46 - #include "udc.h" 47 - #include "pxa27x-udc.h" 48 - #include <mach/smemc.h> 49 - 50 - #include <linux/spi/spi.h> 51 - #include <linux/spi/pxa2xx_spi.h> 52 - #include <linux/mfd/da903x.h> 53 - 54 - #include "devices.h" 55 - #include "generic.h" 56 - 57 - #define STARGATE_NR_IRQS (IRQ_BOARD_START + 8) 58 - 59 - /* Bluetooth */ 60 - #define SG2_BT_RESET 81 61 - 62 - /* SD */ 63 - #define SG2_GPIO_nSD_DETECT 90 64 - #define SG2_SD_POWER_ENABLE 89 65 - 66 - static unsigned long sg2_im2_unified_pin_config[] __initdata = { 67 - /* Device Identification for wakeup*/ 68 - GPIO102_GPIO, 69 - /* DA9030 */ 70 - GPIO1_GPIO, 71 - 72 - /* MMC */ 73 - GPIO32_MMC_CLK, 74 - GPIO112_MMC_CMD, 75 - GPIO92_MMC_DAT_0, 76 - GPIO109_MMC_DAT_1, 77 - GPIO110_MMC_DAT_2, 78 - GPIO111_MMC_DAT_3, 79 - 80 - /* 802.15.4 radio - driver out of mainline */ 81 - GPIO22_GPIO, /* CC_RSTN */ 82 - GPIO114_GPIO, /* CC_FIFO */ 83 - GPIO116_GPIO, /* CC_CCA */ 84 - GPIO0_GPIO, /* CC_FIFOP */ 85 - GPIO16_GPIO, /* CCSFD */ 86 - GPIO115_GPIO, /* Power enable */ 87 - 88 - /* I2C */ 89 - GPIO117_I2C_SCL, 90 - GPIO118_I2C_SDA, 91 - 92 - /* SSP 3 - 802.15.4 radio */ 93 - GPIO39_GPIO, /* Chip Select */ 94 - GPIO34_SSP3_SCLK, 95 - GPIO35_SSP3_TXD, 96 - GPIO41_SSP3_RXD, 97 - 98 - /* SSP 2 to daughter boards */ 99 - GPIO11_SSP2_RXD, 100 - GPIO38_SSP2_TXD, 101 - GPIO36_SSP2_SCLK, 102 - GPIO37_GPIO, /* chip select */ 103 - 104 - /* SSP 1 - to daughter boards */ 105 - GPIO24_GPIO, /* Chip Select */ 106 - GPIO23_SSP1_SCLK, 107 - GPIO25_SSP1_TXD, 108 - GPIO26_SSP1_RXD, 109 - 110 - /* BTUART Basic Connector*/ 111 - GPIO42_BTUART_RXD, 112 - GPIO43_BTUART_TXD, 113 - GPIO44_BTUART_CTS, 114 - GPIO45_BTUART_RTS, 115 - 116 - /* STUART - IM2 via debug board not sure on SG2*/ 117 - GPIO46_STUART_RXD, 118 - GPIO47_STUART_TXD, 119 - 120 - /* Basic sensor board */ 121 - GPIO96_GPIO, /* accelerometer interrupt */ 122 - GPIO99_GPIO, /* ADC interrupt */ 123 - 124 - /* SHT15 */ 125 - GPIO100_GPIO, 126 - GPIO98_GPIO, 127 - 128 - /* Basic sensor board */ 129 - GPIO96_GPIO, /* accelerometer interrupt */ 130 - GPIO99_GPIO, /* ADC interrupt */ 131 - 132 - /* Connector pins specified as gpios */ 133 - GPIO94_GPIO, /* large basic connector pin 14 */ 134 - GPIO10_GPIO, /* large basic connector pin 23 */ 135 - }; 136 - 137 - static struct gpiod_lookup_table sht15_gpiod_table = { 138 - .dev_id = "sht15", 139 - .table = { 140 - /* FIXME: should this have |GPIO_OPEN_DRAIN set? */ 141 - GPIO_LOOKUP("gpio-pxa", 100, "data", GPIO_ACTIVE_HIGH), 142 - GPIO_LOOKUP("gpio-pxa", 98, "clk", GPIO_ACTIVE_HIGH), 143 - }, 144 - }; 145 - 146 - static struct platform_device sht15 = { 147 - .name = "sht15", 148 - .id = -1, 149 - }; 150 - 151 - static struct regulator_consumer_supply stargate2_sensor_3_con[] = { 152 - REGULATOR_SUPPLY("vcc", "sht15"), 153 - }; 154 - 155 - enum stargate2_ldos{ 156 - vcc_vref, 157 - vcc_cc2420, 158 - /* a mote connector? */ 159 - vcc_mica, 160 - /* the CSR bluecore chip */ 161 - vcc_bt, 162 - /* The two voltages available to sensor boards */ 163 - vcc_sensor_1_8, 164 - vcc_sensor_3, 165 - /* directly connected to the pxa27x */ 166 - vcc_sram_ext, 167 - vcc_pxa_pll, 168 - vcc_pxa_usim, /* Reference voltage for certain gpios */ 169 - vcc_pxa_mem, 170 - vcc_pxa_flash, 171 - vcc_pxa_core, /*Dc-Dc buck not yet supported */ 172 - vcc_lcd, 173 - vcc_bb, 174 - vcc_bbio, /*not sure!*/ 175 - vcc_io, /* cc2420 802.15.4 radio and pxa vcc_io ?*/ 176 - }; 177 - 178 - /* The values of the various regulator constraints are obviously dependent 179 - * on exactly what is wired to each ldo. Unfortunately this information is 180 - * not generally available. More information has been requested from Xbow. 181 - */ 182 - static struct regulator_init_data stargate2_ldo_init_data[] = { 183 - [vcc_bbio] = { 184 - .constraints = { /* board default 1.8V */ 185 - .name = "vcc_bbio", 186 - .min_uV = 1800000, 187 - .max_uV = 1800000, 188 - }, 189 - }, 190 - [vcc_bb] = { 191 - .constraints = { /* board default 2.8V */ 192 - .name = "vcc_bb", 193 - .min_uV = 2700000, 194 - .max_uV = 3000000, 195 - }, 196 - }, 197 - [vcc_pxa_flash] = { 198 - .constraints = {/* default is 1.8V */ 199 - .name = "vcc_pxa_flash", 200 - .min_uV = 1800000, 201 - .max_uV = 1800000, 202 - }, 203 - }, 204 - [vcc_cc2420] = { /* also vcc_io */ 205 - .constraints = { 206 - /* board default is 2.8V */ 207 - .name = "vcc_cc2420", 208 - .min_uV = 2700000, 209 - .max_uV = 3300000, 210 - }, 211 - }, 212 - [vcc_vref] = { /* Reference for what? */ 213 - .constraints = { /* default 1.8V */ 214 - .name = "vcc_vref", 215 - .min_uV = 1800000, 216 - .max_uV = 1800000, 217 - }, 218 - }, 219 - [vcc_sram_ext] = { 220 - .constraints = { /* default 2.8V */ 221 - .name = "vcc_sram_ext", 222 - .min_uV = 2800000, 223 - .max_uV = 2800000, 224 - }, 225 - }, 226 - [vcc_mica] = { 227 - .constraints = { /* default 2.8V */ 228 - .name = "vcc_mica", 229 - .min_uV = 2800000, 230 - .max_uV = 2800000, 231 - }, 232 - }, 233 - [vcc_bt] = { 234 - .constraints = { /* default 2.8V */ 235 - .name = "vcc_bt", 236 - .min_uV = 2800000, 237 - .max_uV = 2800000, 238 - }, 239 - }, 240 - [vcc_lcd] = { 241 - .constraints = { /* default 2.8V */ 242 - .name = "vcc_lcd", 243 - .min_uV = 2700000, 244 - .max_uV = 3300000, 245 - }, 246 - }, 247 - [vcc_io] = { /* Same or higher than everything 248 - * bar vccbat and vccusb */ 249 - .constraints = { /* default 2.8V */ 250 - .name = "vcc_io", 251 - .min_uV = 2692000, 252 - .max_uV = 3300000, 253 - }, 254 - }, 255 - [vcc_sensor_1_8] = { 256 - .constraints = { /* default 1.8V */ 257 - .name = "vcc_sensor_1_8", 258 - .min_uV = 1800000, 259 - .max_uV = 1800000, 260 - }, 261 - }, 262 - [vcc_sensor_3] = { /* curiously default 2.8V */ 263 - .constraints = { 264 - .name = "vcc_sensor_3", 265 - .min_uV = 2800000, 266 - .max_uV = 3000000, 267 - }, 268 - .num_consumer_supplies = ARRAY_SIZE(stargate2_sensor_3_con), 269 - .consumer_supplies = stargate2_sensor_3_con, 270 - }, 271 - [vcc_pxa_pll] = { /* 1.17V - 1.43V, default 1.3V*/ 272 - .constraints = { 273 - .name = "vcc_pxa_pll", 274 - .min_uV = 1170000, 275 - .max_uV = 1430000, 276 - }, 277 - }, 278 - [vcc_pxa_usim] = { 279 - .constraints = { /* default 1.8V */ 280 - .name = "vcc_pxa_usim", 281 - .min_uV = 1710000, 282 - .max_uV = 2160000, 283 - }, 284 - }, 285 - [vcc_pxa_mem] = { 286 - .constraints = { /* default 1.8V */ 287 - .name = "vcc_pxa_mem", 288 - .min_uV = 1800000, 289 - .max_uV = 1800000, 290 - }, 291 - }, 292 - }; 293 - 294 - static struct mtd_partition stargate2flash_partitions[] = { 295 - { 296 - .name = "Bootloader", 297 - .size = 0x00040000, 298 - .offset = 0, 299 - .mask_flags = 0, 300 - }, { 301 - .name = "Kernel", 302 - .size = 0x00200000, 303 - .offset = 0x00040000, 304 - .mask_flags = 0 305 - }, { 306 - .name = "Filesystem", 307 - .size = 0x01DC0000, 308 - .offset = 0x00240000, 309 - .mask_flags = 0 310 - }, 311 - }; 312 - 313 - static struct resource flash_resources = { 314 - .start = PXA_CS0_PHYS, 315 - .end = PXA_CS0_PHYS + SZ_32M - 1, 316 - .flags = IORESOURCE_MEM, 317 - }; 318 - 319 - static struct flash_platform_data stargate2_flash_data = { 320 - .map_name = "cfi_probe", 321 - .parts = stargate2flash_partitions, 322 - .nr_parts = ARRAY_SIZE(stargate2flash_partitions), 323 - .name = "PXA27xOnChipROM", 324 - .width = 2, 325 - }; 326 - 327 - static struct platform_device stargate2_flash_device = { 328 - .name = "pxa2xx-flash", 329 - .id = 0, 330 - .dev = { 331 - .platform_data = &stargate2_flash_data, 332 - }, 333 - .resource = &flash_resources, 334 - .num_resources = 1, 335 - }; 336 - 337 - static struct pxa2xx_spi_controller pxa_ssp_master_0_info = { 338 - .num_chipselect = 1, 339 - }; 340 - 341 - static struct pxa2xx_spi_controller pxa_ssp_master_1_info = { 342 - .num_chipselect = 1, 343 - }; 344 - 345 - static struct pxa2xx_spi_controller pxa_ssp_master_2_info = { 346 - .num_chipselect = 1, 347 - }; 348 - 349 - /* An upcoming kernel change will scrap SFRM usage so these 350 - * drivers have been moved to use GPIOs */ 351 - static struct pxa2xx_spi_chip staccel_chip_info = { 352 - .tx_threshold = 8, 353 - .rx_threshold = 8, 354 - .dma_burst_size = 8, 355 - .timeout = 235, 356 - .gpio_cs = 24, 357 - }; 358 - 359 - static struct pxa2xx_spi_chip cc2420_info = { 360 - .tx_threshold = 8, 361 - .rx_threshold = 8, 362 - .dma_burst_size = 8, 363 - .timeout = 235, 364 - .gpio_cs = 39, 365 - }; 366 - 367 - static struct spi_board_info spi_board_info[] __initdata = { 368 - { 369 - .modalias = "lis3l02dq", 370 - .max_speed_hz = 8000000,/* 8MHz max spi frequency at 3V */ 371 - .bus_num = 1, 372 - .chip_select = 0, 373 - .controller_data = &staccel_chip_info, 374 - .irq = PXA_GPIO_TO_IRQ(96), 375 - }, { 376 - .modalias = "cc2420", 377 - .max_speed_hz = 6500000, 378 - .bus_num = 3, 379 - .chip_select = 0, 380 - .controller_data = &cc2420_info, 381 - }, 382 - }; 383 - 384 - static void sg2_udc_command(int cmd) 385 - { 386 - switch (cmd) { 387 - case PXA2XX_UDC_CMD_CONNECT: 388 - UP2OCR |= UP2OCR_HXOE | UP2OCR_DPPUE | UP2OCR_DPPUBE; 389 - break; 390 - case PXA2XX_UDC_CMD_DISCONNECT: 391 - UP2OCR &= ~(UP2OCR_HXOE | UP2OCR_DPPUE | UP2OCR_DPPUBE); 392 - break; 393 - } 394 - } 395 - 396 - static struct i2c_pxa_platform_data i2c_pwr_pdata = { 397 - .fast_mode = 1, 398 - }; 399 - 400 - static struct i2c_pxa_platform_data i2c_pdata = { 401 - .fast_mode = 1, 402 - }; 403 - 404 - static void __init imote2_stargate2_init(void) 405 - { 406 - 407 - pxa2xx_mfp_config(ARRAY_AND_SIZE(sg2_im2_unified_pin_config)); 408 - 409 - pxa_set_ffuart_info(NULL); 410 - pxa_set_btuart_info(NULL); 411 - pxa_set_stuart_info(NULL); 412 - 413 - pxa2xx_set_spi_info(1, &pxa_ssp_master_0_info); 414 - pxa2xx_set_spi_info(2, &pxa_ssp_master_1_info); 415 - pxa2xx_set_spi_info(3, &pxa_ssp_master_2_info); 416 - spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); 417 - 418 - 419 - pxa27x_set_i2c_power_info(&i2c_pwr_pdata); 420 - pxa_set_i2c_info(&i2c_pdata); 421 - } 422 - 423 - #ifdef CONFIG_MACH_INTELMOTE2 424 - /* As the the imote2 doesn't currently have a conventional SD slot 425 - * there is no option to hotplug cards, making all this rather simple 426 - */ 427 - static int imote2_mci_get_ro(struct device *dev) 428 - { 429 - return 0; 430 - } 431 - 432 - /* Rather simple case as hotplugging not possible */ 433 - static struct pxamci_platform_data imote2_mci_platform_data = { 434 - .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, /* default anyway */ 435 - .get_ro = imote2_mci_get_ro, 436 - }; 437 - 438 - static struct gpio_led imote2_led_pins[] = { 439 - { 440 - .name = "imote2:red", 441 - .gpio = 103, 442 - .active_low = 1, 443 - }, { 444 - .name = "imote2:green", 445 - .gpio = 104, 446 - .active_low = 1, 447 - }, { 448 - .name = "imote2:blue", 449 - .gpio = 105, 450 - .active_low = 1, 451 - }, 452 - }; 453 - 454 - static struct gpio_led_platform_data imote2_led_data = { 455 - .num_leds = ARRAY_SIZE(imote2_led_pins), 456 - .leds = imote2_led_pins, 457 - }; 458 - 459 - static struct platform_device imote2_leds = { 460 - .name = "leds-gpio", 461 - .id = -1, 462 - .dev = { 463 - .platform_data = &imote2_led_data, 464 - }, 465 - }; 466 - 467 - static struct da903x_subdev_info imote2_da9030_subdevs[] = { 468 - { 469 - .name = "da903x-regulator", 470 - .id = DA9030_ID_LDO2, 471 - .platform_data = &stargate2_ldo_init_data[vcc_bbio], 472 - }, { 473 - .name = "da903x-regulator", 474 - .id = DA9030_ID_LDO3, 475 - .platform_data = &stargate2_ldo_init_data[vcc_bb], 476 - }, { 477 - .name = "da903x-regulator", 478 - .id = DA9030_ID_LDO4, 479 - .platform_data = &stargate2_ldo_init_data[vcc_pxa_flash], 480 - }, { 481 - .name = "da903x-regulator", 482 - .id = DA9030_ID_LDO5, 483 - .platform_data = &stargate2_ldo_init_data[vcc_cc2420], 484 - }, { 485 - .name = "da903x-regulator", 486 - .id = DA9030_ID_LDO6, 487 - .platform_data = &stargate2_ldo_init_data[vcc_vref], 488 - }, { 489 - .name = "da903x-regulator", 490 - .id = DA9030_ID_LDO7, 491 - .platform_data = &stargate2_ldo_init_data[vcc_sram_ext], 492 - }, { 493 - .name = "da903x-regulator", 494 - .id = DA9030_ID_LDO8, 495 - .platform_data = &stargate2_ldo_init_data[vcc_mica], 496 - }, { 497 - .name = "da903x-regulator", 498 - .id = DA9030_ID_LDO9, 499 - .platform_data = &stargate2_ldo_init_data[vcc_bt], 500 - }, { 501 - .name = "da903x-regulator", 502 - .id = DA9030_ID_LDO10, 503 - .platform_data = &stargate2_ldo_init_data[vcc_sensor_1_8], 504 - }, { 505 - .name = "da903x-regulator", 506 - .id = DA9030_ID_LDO11, 507 - .platform_data = &stargate2_ldo_init_data[vcc_sensor_3], 508 - }, { 509 - .name = "da903x-regulator", 510 - .id = DA9030_ID_LDO12, 511 - .platform_data = &stargate2_ldo_init_data[vcc_lcd], 512 - }, { 513 - .name = "da903x-regulator", 514 - .id = DA9030_ID_LDO15, 515 - .platform_data = &stargate2_ldo_init_data[vcc_pxa_pll], 516 - }, { 517 - .name = "da903x-regulator", 518 - .id = DA9030_ID_LDO17, 519 - .platform_data = &stargate2_ldo_init_data[vcc_pxa_usim], 520 - }, { 521 - .name = "da903x-regulator", /*pxa vcc i/o and cc2420 vcc i/o */ 522 - .id = DA9030_ID_LDO18, 523 - .platform_data = &stargate2_ldo_init_data[vcc_io], 524 - }, { 525 - .name = "da903x-regulator", 526 - .id = DA9030_ID_LDO19, 527 - .platform_data = &stargate2_ldo_init_data[vcc_pxa_mem], 528 - }, 529 - }; 530 - 531 - static struct da903x_platform_data imote2_da9030_pdata = { 532 - .num_subdevs = ARRAY_SIZE(imote2_da9030_subdevs), 533 - .subdevs = imote2_da9030_subdevs, 534 - }; 535 - 536 - static struct i2c_board_info __initdata imote2_pwr_i2c_board_info[] = { 537 - { 538 - .type = "da9030", 539 - .addr = 0x49, 540 - .platform_data = &imote2_da9030_pdata, 541 - .irq = PXA_GPIO_TO_IRQ(1), 542 - }, 543 - }; 544 - 545 - static struct i2c_board_info __initdata imote2_i2c_board_info[] = { 546 - { /* UCAM sensor board */ 547 - .type = "max1239", 548 - .addr = 0x35, 549 - }, { /* ITS400 Sensor board only */ 550 - .type = "max1363", 551 - .addr = 0x34, 552 - /* Through a nand gate - Also beware, on V2 sensor board the 553 - * pull up resistors are missing. 554 - */ 555 - .irq = PXA_GPIO_TO_IRQ(99), 556 - }, { /* ITS400 Sensor board only */ 557 - .type = "tsl2561", 558 - .addr = 0x49, 559 - /* Through a nand gate - Also beware, on V2 sensor board the 560 - * pull up resistors are missing. 561 - */ 562 - .irq = PXA_GPIO_TO_IRQ(99), 563 - }, { /* ITS400 Sensor board only */ 564 - .type = "tmp175", 565 - .addr = 0x4A, 566 - .irq = PXA_GPIO_TO_IRQ(96), 567 - }, { /* IMB400 Multimedia board */ 568 - .type = "wm8940", 569 - .addr = 0x1A, 570 - }, 571 - }; 572 - 573 - static unsigned long imote2_pin_config[] __initdata = { 574 - 575 - /* Button */ 576 - GPIO91_GPIO, 577 - 578 - /* LEDS */ 579 - GPIO103_GPIO, /* red led */ 580 - GPIO104_GPIO, /* green led */ 581 - GPIO105_GPIO, /* blue led */ 582 - }; 583 - 584 - static struct pxa2xx_udc_mach_info imote2_udc_info __initdata = { 585 - .udc_command = sg2_udc_command, 586 - }; 587 - 588 - static struct platform_device imote2_audio_device = { 589 - .name = "imote2-audio", 590 - .id = -1, 591 - }; 592 - 593 - static struct platform_device *imote2_devices[] = { 594 - &stargate2_flash_device, 595 - &imote2_leds, 596 - &sht15, 597 - &imote2_audio_device, 598 - }; 599 - 600 - static void __init imote2_init(void) 601 - { 602 - pxa2xx_mfp_config(ARRAY_AND_SIZE(imote2_pin_config)); 603 - 604 - imote2_stargate2_init(); 605 - 606 - gpiod_add_lookup_table(&sht15_gpiod_table); 607 - platform_add_devices(imote2_devices, ARRAY_SIZE(imote2_devices)); 608 - 609 - i2c_register_board_info(0, imote2_i2c_board_info, 610 - ARRAY_SIZE(imote2_i2c_board_info)); 611 - i2c_register_board_info(1, imote2_pwr_i2c_board_info, 612 - ARRAY_SIZE(imote2_pwr_i2c_board_info)); 613 - 614 - pxa_set_mci_info(&imote2_mci_platform_data); 615 - pxa_set_udc_info(&imote2_udc_info); 616 - } 617 - #endif 618 - 619 - #ifdef CONFIG_MACH_STARGATE2 620 - 621 - static unsigned long stargate2_pin_config[] __initdata = { 622 - 623 - GPIO15_nCS_1, /* SRAM */ 624 - /* SMC91x */ 625 - GPIO80_nCS_4, 626 - GPIO40_GPIO, /*cable detect?*/ 627 - 628 - /* Button */ 629 - GPIO91_GPIO | WAKEUP_ON_LEVEL_HIGH, 630 - 631 - /* Compact Flash */ 632 - GPIO79_PSKTSEL, 633 - GPIO48_nPOE, 634 - GPIO49_nPWE, 635 - GPIO50_nPIOR, 636 - GPIO51_nPIOW, 637 - GPIO85_nPCE_1, 638 - GPIO54_nPCE_2, 639 - GPIO55_nPREG, 640 - GPIO56_nPWAIT, 641 - GPIO57_nIOIS16, 642 - GPIO120_GPIO, /* Buff ctrl */ 643 - GPIO108_GPIO, /* Power ctrl */ 644 - GPIO82_GPIO, /* Reset */ 645 - GPIO53_GPIO, /* SG2_S0_GPIO_DETECT */ 646 - 647 - /* MMC not shared with imote2 */ 648 - GPIO90_GPIO, /* nSD detect */ 649 - GPIO89_GPIO, /* SD_POWER_ENABLE */ 650 - 651 - /* Bluetooth */ 652 - GPIO81_GPIO, /* reset */ 653 - }; 654 - 655 - static struct resource smc91x_resources[] = { 656 - [0] = { 657 - .name = "smc91x-regs", 658 - .start = (PXA_CS4_PHYS + 0x300), 659 - .end = (PXA_CS4_PHYS + 0xfffff), 660 - .flags = IORESOURCE_MEM, 661 - }, 662 - [1] = { 663 - .start = PXA_GPIO_TO_IRQ(40), 664 - .end = PXA_GPIO_TO_IRQ(40), 665 - .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, 666 - } 667 - }; 668 - 669 - static struct smc91x_platdata stargate2_smc91x_info = { 670 - .flags = SMC91X_USE_8BIT | SMC91X_USE_16BIT | SMC91X_USE_32BIT 671 - | SMC91X_NOWAIT | SMC91X_USE_DMA, 672 - .pxa_u16_align4 = true, 673 - }; 674 - 675 - static struct platform_device smc91x_device = { 676 - .name = "smc91x", 677 - .id = -1, 678 - .num_resources = ARRAY_SIZE(smc91x_resources), 679 - .resource = smc91x_resources, 680 - .dev = { 681 - .platform_data = &stargate2_smc91x_info, 682 - }, 683 - }; 684 - 685 - 686 - /* 687 - * The card detect interrupt isn't debounced so we delay it by 250ms 688 - * to give the card a chance to fully insert / eject. 689 - */ 690 - static int stargate2_mci_init(struct device *dev, 691 - irq_handler_t stargate2_detect_int, 692 - void *data) 693 - { 694 - int err; 695 - 696 - err = gpio_request(SG2_SD_POWER_ENABLE, "SG2_sd_power_enable"); 697 - if (err) { 698 - printk(KERN_ERR "Can't get the gpio for SD power control"); 699 - goto return_err; 700 - } 701 - gpio_direction_output(SG2_SD_POWER_ENABLE, 0); 702 - 703 - err = gpio_request(SG2_GPIO_nSD_DETECT, "SG2_sd_detect"); 704 - if (err) { 705 - printk(KERN_ERR "Can't get the sd detect gpio"); 706 - goto free_power_en; 707 - } 708 - gpio_direction_input(SG2_GPIO_nSD_DETECT); 709 - 710 - err = request_irq(PXA_GPIO_TO_IRQ(SG2_GPIO_nSD_DETECT), 711 - stargate2_detect_int, 712 - IRQ_TYPE_EDGE_BOTH, 713 - "MMC card detect", 714 - data); 715 - if (err) { 716 - printk(KERN_ERR "can't request MMC card detect IRQ\n"); 717 - goto free_nsd_detect; 718 - } 719 - return 0; 720 - 721 - free_nsd_detect: 722 - gpio_free(SG2_GPIO_nSD_DETECT); 723 - free_power_en: 724 - gpio_free(SG2_SD_POWER_ENABLE); 725 - return_err: 726 - return err; 727 - } 728 - 729 - /** 730 - * stargate2_mci_setpower() - set state of mmc power supply 731 - * 732 - * Very simple control. Either it is on or off and is controlled by 733 - * a gpio pin */ 734 - static int stargate2_mci_setpower(struct device *dev, unsigned int vdd) 735 - { 736 - gpio_set_value(SG2_SD_POWER_ENABLE, !!vdd); 737 - return 0; 738 - } 739 - 740 - static void stargate2_mci_exit(struct device *dev, void *data) 741 - { 742 - free_irq(PXA_GPIO_TO_IRQ(SG2_GPIO_nSD_DETECT), data); 743 - gpio_free(SG2_SD_POWER_ENABLE); 744 - gpio_free(SG2_GPIO_nSD_DETECT); 745 - } 746 - 747 - static struct pxamci_platform_data stargate2_mci_platform_data = { 748 - .detect_delay_ms = 250, 749 - .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, 750 - .init = stargate2_mci_init, 751 - .setpower = stargate2_mci_setpower, 752 - .exit = stargate2_mci_exit, 753 - }; 754 - 755 - 756 - /* 757 - * SRAM - The Stargate 2 has 32MB of SRAM. 758 - * 759 - * Here it is made available as an MTD. This will then 760 - * typically have a cifs filesystem created on it to provide 761 - * fast temporary storage. 762 - */ 763 - static struct resource sram_resources = { 764 - .start = PXA_CS1_PHYS, 765 - .end = PXA_CS1_PHYS + SZ_32M-1, 766 - .flags = IORESOURCE_MEM, 767 - }; 768 - 769 - static struct platdata_mtd_ram stargate2_sram_pdata = { 770 - .mapname = "Stargate2 SRAM", 771 - .bankwidth = 2, 772 - }; 773 - 774 - static struct platform_device stargate2_sram = { 775 - .name = "mtd-ram", 776 - .id = 0, 777 - .resource = &sram_resources, 778 - .num_resources = 1, 779 - .dev = { 780 - .platform_data = &stargate2_sram_pdata, 781 - }, 782 - }; 783 - 784 - static struct pcf857x_platform_data platform_data_pcf857x = { 785 - .gpio_base = 128, 786 - .n_latch = 0, 787 - .setup = NULL, 788 - .teardown = NULL, 789 - .context = NULL, 790 - }; 791 - 792 - static const struct property_entry pca9500_eeprom_properties[] = { 793 - PROPERTY_ENTRY_U32("pagesize", 4), 794 - { } 795 - }; 796 - 797 - static const struct software_node pca9500_eeprom_node = { 798 - .properties = pca9500_eeprom_properties, 799 - }; 800 - 801 - /** 802 - * stargate2_reset_bluetooth() reset the bluecore to ensure consistent state 803 - **/ 804 - static int stargate2_reset_bluetooth(void) 805 - { 806 - int err; 807 - err = gpio_request(SG2_BT_RESET, "SG2_BT_RESET"); 808 - if (err) { 809 - printk(KERN_ERR "Could not get gpio for bluetooth reset\n"); 810 - return err; 811 - } 812 - gpio_direction_output(SG2_BT_RESET, 1); 813 - mdelay(5); 814 - /* now reset it - 5 msec minimum */ 815 - gpio_set_value(SG2_BT_RESET, 0); 816 - mdelay(10); 817 - gpio_set_value(SG2_BT_RESET, 1); 818 - gpio_free(SG2_BT_RESET); 819 - return 0; 820 - } 821 - 822 - static struct led_info stargate2_leds[] = { 823 - { 824 - .name = "sg2:red", 825 - .flags = DA9030_LED_RATE_ON, 826 - }, { 827 - .name = "sg2:blue", 828 - .flags = DA9030_LED_RATE_ON, 829 - }, { 830 - .name = "sg2:green", 831 - .flags = DA9030_LED_RATE_ON, 832 - }, 833 - }; 834 - 835 - static struct da903x_subdev_info stargate2_da9030_subdevs[] = { 836 - { 837 - .name = "da903x-led", 838 - .id = DA9030_ID_LED_2, 839 - .platform_data = &stargate2_leds[0], 840 - }, { 841 - .name = "da903x-led", 842 - .id = DA9030_ID_LED_3, 843 - .platform_data = &stargate2_leds[2], 844 - }, { 845 - .name = "da903x-led", 846 - .id = DA9030_ID_LED_4, 847 - .platform_data = &stargate2_leds[1], 848 - }, { 849 - .name = "da903x-regulator", 850 - .id = DA9030_ID_LDO2, 851 - .platform_data = &stargate2_ldo_init_data[vcc_bbio], 852 - }, { 853 - .name = "da903x-regulator", 854 - .id = DA9030_ID_LDO3, 855 - .platform_data = &stargate2_ldo_init_data[vcc_bb], 856 - }, { 857 - .name = "da903x-regulator", 858 - .id = DA9030_ID_LDO4, 859 - .platform_data = &stargate2_ldo_init_data[vcc_pxa_flash], 860 - }, { 861 - .name = "da903x-regulator", 862 - .id = DA9030_ID_LDO5, 863 - .platform_data = &stargate2_ldo_init_data[vcc_cc2420], 864 - }, { 865 - .name = "da903x-regulator", 866 - .id = DA9030_ID_LDO6, 867 - .platform_data = &stargate2_ldo_init_data[vcc_vref], 868 - }, { 869 - .name = "da903x-regulator", 870 - .id = DA9030_ID_LDO7, 871 - .platform_data = &stargate2_ldo_init_data[vcc_sram_ext], 872 - }, { 873 - .name = "da903x-regulator", 874 - .id = DA9030_ID_LDO8, 875 - .platform_data = &stargate2_ldo_init_data[vcc_mica], 876 - }, { 877 - .name = "da903x-regulator", 878 - .id = DA9030_ID_LDO9, 879 - .platform_data = &stargate2_ldo_init_data[vcc_bt], 880 - }, { 881 - .name = "da903x-regulator", 882 - .id = DA9030_ID_LDO10, 883 - .platform_data = &stargate2_ldo_init_data[vcc_sensor_1_8], 884 - }, { 885 - .name = "da903x-regulator", 886 - .id = DA9030_ID_LDO11, 887 - .platform_data = &stargate2_ldo_init_data[vcc_sensor_3], 888 - }, { 889 - .name = "da903x-regulator", 890 - .id = DA9030_ID_LDO12, 891 - .platform_data = &stargate2_ldo_init_data[vcc_lcd], 892 - }, { 893 - .name = "da903x-regulator", 894 - .id = DA9030_ID_LDO15, 895 - .platform_data = &stargate2_ldo_init_data[vcc_pxa_pll], 896 - }, { 897 - .name = "da903x-regulator", 898 - .id = DA9030_ID_LDO17, 899 - .platform_data = &stargate2_ldo_init_data[vcc_pxa_usim], 900 - }, { 901 - .name = "da903x-regulator", /*pxa vcc i/o and cc2420 vcc i/o */ 902 - .id = DA9030_ID_LDO18, 903 - .platform_data = &stargate2_ldo_init_data[vcc_io], 904 - }, { 905 - .name = "da903x-regulator", 906 - .id = DA9030_ID_LDO19, 907 - .platform_data = &stargate2_ldo_init_data[vcc_pxa_mem], 908 - }, 909 - }; 910 - 911 - static struct da903x_platform_data stargate2_da9030_pdata = { 912 - .num_subdevs = ARRAY_SIZE(stargate2_da9030_subdevs), 913 - .subdevs = stargate2_da9030_subdevs, 914 - }; 915 - 916 - static struct i2c_board_info __initdata stargate2_pwr_i2c_board_info[] = { 917 - { 918 - .type = "da9030", 919 - .addr = 0x49, 920 - .platform_data = &stargate2_da9030_pdata, 921 - .irq = PXA_GPIO_TO_IRQ(1), 922 - }, 923 - }; 924 - 925 - static struct i2c_board_info __initdata stargate2_i2c_board_info[] = { 926 - /* Techically this a pca9500 - but it's compatible with the 8574 927 - * for gpio expansion and the 24c02 for eeprom access. 928 - */ 929 - { 930 - .type = "pcf8574", 931 - .addr = 0x27, 932 - .platform_data = &platform_data_pcf857x, 933 - }, { 934 - .type = "24c02", 935 - .addr = 0x57, 936 - .swnode = &pca9500_eeprom_node, 937 - }, { 938 - .type = "max1238", 939 - .addr = 0x35, 940 - }, { /* ITS400 Sensor board only */ 941 - .type = "max1363", 942 - .addr = 0x34, 943 - /* Through a nand gate - Also beware, on V2 sensor board the 944 - * pull up resistors are missing. 945 - */ 946 - .irq = PXA_GPIO_TO_IRQ(99), 947 - }, { /* ITS400 Sensor board only */ 948 - .type = "tsl2561", 949 - .addr = 0x49, 950 - /* Through a nand gate - Also beware, on V2 sensor board the 951 - * pull up resistors are missing. 952 - */ 953 - .irq = PXA_GPIO_TO_IRQ(99), 954 - }, { /* ITS400 Sensor board only */ 955 - .type = "tmp175", 956 - .addr = 0x4A, 957 - .irq = PXA_GPIO_TO_IRQ(96), 958 - }, 959 - }; 960 - 961 - /* Board doesn't support cable detection - so always lie and say 962 - * something is there. 963 - */ 964 - static int sg2_udc_detect(void) 965 - { 966 - return 1; 967 - } 968 - 969 - static struct pxa2xx_udc_mach_info stargate2_udc_info __initdata = { 970 - .udc_is_connected = sg2_udc_detect, 971 - .udc_command = sg2_udc_command, 972 - }; 973 - 974 - static struct platform_device *stargate2_devices[] = { 975 - &stargate2_flash_device, 976 - &stargate2_sram, 977 - &smc91x_device, 978 - &sht15, 979 - }; 980 - 981 - static void __init stargate2_init(void) 982 - { 983 - /* This is probably a board specific hack as this must be set 984 - prior to connecting the MFP stuff up. */ 985 - __raw_writel(__raw_readl(MECR) & ~MECR_NOS, MECR); 986 - 987 - pxa2xx_mfp_config(ARRAY_AND_SIZE(stargate2_pin_config)); 988 - 989 - imote2_stargate2_init(); 990 - 991 - gpiod_add_lookup_table(&sht15_gpiod_table); 992 - platform_add_devices(ARRAY_AND_SIZE(stargate2_devices)); 993 - 994 - i2c_register_board_info(0, ARRAY_AND_SIZE(stargate2_i2c_board_info)); 995 - i2c_register_board_info(1, stargate2_pwr_i2c_board_info, 996 - ARRAY_SIZE(stargate2_pwr_i2c_board_info)); 997 - 998 - pxa_set_mci_info(&stargate2_mci_platform_data); 999 - 1000 - pxa_set_udc_info(&stargate2_udc_info); 1001 - 1002 - stargate2_reset_bluetooth(); 1003 - } 1004 - #endif 1005 - 1006 - #ifdef CONFIG_MACH_INTELMOTE2 1007 - MACHINE_START(INTELMOTE2, "IMOTE 2") 1008 - .map_io = pxa27x_map_io, 1009 - .nr_irqs = PXA_NR_IRQS, 1010 - .init_irq = pxa27x_init_irq, 1011 - .handle_irq = pxa27x_handle_irq, 1012 - .init_time = pxa_timer_init, 1013 - .init_machine = imote2_init, 1014 - .atag_offset = 0x100, 1015 - .restart = pxa_restart, 1016 - MACHINE_END 1017 - #endif 1018 - 1019 - #ifdef CONFIG_MACH_STARGATE2 1020 - MACHINE_START(STARGATE2, "Stargate 2") 1021 - .map_io = pxa27x_map_io, 1022 - .nr_irqs = STARGATE_NR_IRQS, 1023 - .init_irq = pxa27x_init_irq, 1024 - .handle_irq = pxa27x_handle_irq, 1025 - .init_time = pxa_timer_init, 1026 - .init_machine = stargate2_init, 1027 - .atag_offset = 0x100, 1028 - .restart = pxa_restart, 1029 - MACHINE_END 1030 - #endif
+1 -1
drivers/pcmcia/Kconfig
··· 210 210 depends on ARM && ARCH_PXA && PCMCIA 211 211 depends on (ARCH_LUBBOCK || MACH_MAINSTONE || PXA_SHARPSL \ 212 212 || ARCH_PXA_PALM || TRIZEPS_PCMCIA \ 213 - || ARCOM_PCMCIA || ARCH_PXA_ESERIES || MACH_STARGATE2 \ 213 + || ARCOM_PCMCIA || ARCH_PXA_ESERIES \ 214 214 || MACH_VPAC270 || MACH_BALLOON3 || MACH_COLIBRI \ 215 215 || MACH_COLIBRI320 || MACH_H4700) 216 216 select PCMCIA_SOC_COMMON
-1
drivers/pcmcia/Makefile
··· 56 56 pxa2xx-obj-$(CONFIG_MACH_PALMTC) += pxa2xx_palmtc.o 57 57 pxa2xx-obj-$(CONFIG_MACH_PALMLD) += pxa2xx_palmld.o 58 58 pxa2xx-obj-$(CONFIG_MACH_E740) += pxa2xx_e740.o 59 - pxa2xx-obj-$(CONFIG_MACH_STARGATE2) += pxa2xx_stargate2.o 60 59 pxa2xx-obj-$(CONFIG_MACH_VPAC270) += pxa2xx_vpac270.o 61 60 pxa2xx-obj-$(CONFIG_MACH_BALLOON3) += pxa2xx_balloon3.o 62 61 pxa2xx-obj-$(CONFIG_MACH_COLIBRI) += pxa2xx_colibri.o
-137
drivers/pcmcia/pxa2xx_stargate2.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * linux/drivers/pcmcia/pxa2xx_stargate2.c 4 - * 5 - * Stargate 2 PCMCIA specific routines. 6 - * 7 - * Created: December 6, 2005 8 - * Author: Ed C. Epp 9 - * Copyright: Intel Corp 2005 10 - * Jonathan Cameron <jic23@cam.ac.uk> 2009 11 - */ 12 - 13 - #include <linux/module.h> 14 - #include <linux/init.h> 15 - #include <linux/kernel.h> 16 - #include <linux/interrupt.h> 17 - #include <linux/delay.h> 18 - #include <linux/platform_device.h> 19 - #include <linux/gpio.h> 20 - 21 - #include <pcmcia/ss.h> 22 - 23 - #include <asm/irq.h> 24 - #include <asm/mach-types.h> 25 - 26 - #include "soc_common.h" 27 - 28 - #define SG2_S0_POWER_CTL 108 29 - #define SG2_S0_GPIO_RESET 82 30 - #define SG2_S0_GPIO_DETECT 53 31 - #define SG2_S0_GPIO_READY 81 32 - 33 - static struct gpio sg2_pcmcia_gpios[] = { 34 - { SG2_S0_GPIO_RESET, GPIOF_OUT_INIT_HIGH, "PCMCIA Reset" }, 35 - { SG2_S0_POWER_CTL, GPIOF_OUT_INIT_HIGH, "PCMCIA Power Ctrl" }, 36 - }; 37 - 38 - static int sg2_pcmcia_hw_init(struct soc_pcmcia_socket *skt) 39 - { 40 - skt->stat[SOC_STAT_CD].gpio = SG2_S0_GPIO_DETECT; 41 - skt->stat[SOC_STAT_CD].name = "PCMCIA0 CD"; 42 - skt->stat[SOC_STAT_RDY].gpio = SG2_S0_GPIO_READY; 43 - skt->stat[SOC_STAT_RDY].name = "PCMCIA0 RDY"; 44 - return 0; 45 - } 46 - 47 - static void sg2_pcmcia_socket_state(struct soc_pcmcia_socket *skt, 48 - struct pcmcia_state *state) 49 - { 50 - state->bvd1 = 0; /* not available - battery detect on card */ 51 - state->bvd2 = 0; /* not available */ 52 - state->vs_3v = 1; /* not available - voltage detect for card */ 53 - state->vs_Xv = 0; /* not available */ 54 - } 55 - 56 - static int sg2_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, 57 - const socket_state_t *state) 58 - { 59 - /* Enable card power */ 60 - switch (state->Vcc) { 61 - case 0: 62 - /* sets power ctl register high */ 63 - gpio_set_value(SG2_S0_POWER_CTL, 1); 64 - break; 65 - case 33: 66 - case 50: 67 - /* sets power control register low (clear) */ 68 - gpio_set_value(SG2_S0_POWER_CTL, 0); 69 - msleep(100); 70 - break; 71 - default: 72 - pr_err("%s(): bad Vcc %u\n", 73 - __func__, state->Vcc); 74 - return -1; 75 - } 76 - 77 - /* reset */ 78 - gpio_set_value(SG2_S0_GPIO_RESET, !!(state->flags & SS_RESET)); 79 - 80 - return 0; 81 - } 82 - 83 - static struct pcmcia_low_level sg2_pcmcia_ops __initdata = { 84 - .owner = THIS_MODULE, 85 - .hw_init = sg2_pcmcia_hw_init, 86 - .socket_state = sg2_pcmcia_socket_state, 87 - .configure_socket = sg2_pcmcia_configure_socket, 88 - .nr = 1, 89 - }; 90 - 91 - static struct platform_device *sg2_pcmcia_device; 92 - 93 - static int __init sg2_pcmcia_init(void) 94 - { 95 - int ret; 96 - 97 - if (!machine_is_stargate2()) 98 - return -ENODEV; 99 - 100 - sg2_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1); 101 - if (!sg2_pcmcia_device) 102 - return -ENOMEM; 103 - 104 - ret = gpio_request_array(sg2_pcmcia_gpios, ARRAY_SIZE(sg2_pcmcia_gpios)); 105 - if (ret) 106 - goto error_put_platform_device; 107 - 108 - ret = platform_device_add_data(sg2_pcmcia_device, 109 - &sg2_pcmcia_ops, 110 - sizeof(sg2_pcmcia_ops)); 111 - if (ret) 112 - goto error_free_gpios; 113 - 114 - ret = platform_device_add(sg2_pcmcia_device); 115 - if (ret) 116 - goto error_free_gpios; 117 - 118 - return 0; 119 - error_free_gpios: 120 - gpio_free_array(sg2_pcmcia_gpios, ARRAY_SIZE(sg2_pcmcia_gpios)); 121 - error_put_platform_device: 122 - platform_device_put(sg2_pcmcia_device); 123 - 124 - return ret; 125 - } 126 - 127 - static void __exit sg2_pcmcia_exit(void) 128 - { 129 - platform_device_unregister(sg2_pcmcia_device); 130 - gpio_free_array(sg2_pcmcia_gpios, ARRAY_SIZE(sg2_pcmcia_gpios)); 131 - } 132 - 133 - fs_initcall(sg2_pcmcia_init); 134 - module_exit(sg2_pcmcia_exit); 135 - 136 - MODULE_LICENSE("GPL"); 137 - MODULE_ALIAS("platform:pxa2xx-pcmcia");
-9
sound/soc/pxa/Kconfig
··· 220 220 Say Y if you want to add support for SoC audio on the 221 221 MIO A701. 222 222 223 - config SND_PXA2XX_SOC_IMOTE2 224 - tristate "SoC Audio support for IMote 2" 225 - depends on SND_PXA2XX_SOC && MACH_INTELMOTE2 && I2C 226 - select SND_PXA2XX_SOC_I2S 227 - select SND_SOC_WM8940 228 - help 229 - Say Y if you want to add support for SoC audio on the 230 - IMote 2. 231 - 232 223 config SND_MMP_SOC_BROWNSTONE 233 224 tristate "SoC Audio support for Marvell Brownstone" 234 225 depends on SND_MMP_SOC_SSPA && MACH_BROWNSTONE && I2C
-2
sound/soc/pxa/Makefile
··· 29 29 snd-soc-magician-objs := magician.o 30 30 snd-soc-mioa701-objs := mioa701_wm9713.o 31 31 snd-soc-z2-objs := z2.o 32 - snd-soc-imote2-objs := imote2.o 33 32 snd-soc-brownstone-objs := brownstone.o 34 33 snd-soc-ttc-dkb-objs := ttc-dkb.o 35 34 ··· 46 47 obj-$(CONFIG_SND_PXA2XX_SOC_MIOA701) += snd-soc-mioa701.o 47 48 obj-$(CONFIG_SND_PXA2XX_SOC_Z2) += snd-soc-z2.o 48 49 obj-$(CONFIG_SND_SOC_ZYLONITE) += snd-soc-zylonite.o 49 - obj-$(CONFIG_SND_PXA2XX_SOC_IMOTE2) += snd-soc-imote2.o 50 50 obj-$(CONFIG_SND_MMP_SOC_BROWNSTONE) += snd-soc-brownstone.o 51 51 obj-$(CONFIG_SND_SOC_TTC_DKB) += snd-soc-ttc-dkb.o
-99
sound/soc/pxa/imote2.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - 3 - #include <linux/module.h> 4 - #include <sound/soc.h> 5 - 6 - #include <asm/mach-types.h> 7 - 8 - #include "../codecs/wm8940.h" 9 - #include "pxa2xx-i2s.h" 10 - 11 - static int imote2_asoc_hw_params(struct snd_pcm_substream *substream, 12 - struct snd_pcm_hw_params *params) 13 - { 14 - struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 15 - struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); 16 - struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); 17 - unsigned int clk = 0; 18 - int ret; 19 - 20 - switch (params_rate(params)) { 21 - case 8000: 22 - case 16000: 23 - case 48000: 24 - case 96000: 25 - clk = 12288000; 26 - break; 27 - case 11025: 28 - case 22050: 29 - case 44100: 30 - clk = 11289600; 31 - break; 32 - } 33 - 34 - ret = snd_soc_dai_set_sysclk(codec_dai, 0, clk, 35 - SND_SOC_CLOCK_IN); 36 - if (ret < 0) 37 - return ret; 38 - 39 - /* set the I2S system clock as input (unused) */ 40 - ret = snd_soc_dai_set_sysclk(cpu_dai, PXA2XX_I2S_SYSCLK, clk, 41 - SND_SOC_CLOCK_OUT); 42 - 43 - return ret; 44 - } 45 - 46 - static const struct snd_soc_ops imote2_asoc_ops = { 47 - .hw_params = imote2_asoc_hw_params, 48 - }; 49 - 50 - SND_SOC_DAILINK_DEFS(wm8940, 51 - DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-i2s")), 52 - DAILINK_COMP_ARRAY(COMP_CODEC("wm8940-codec.0-0034", 53 - "wm8940-hifi")), 54 - DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio"))); 55 - 56 - static struct snd_soc_dai_link imote2_dai = { 57 - .name = "WM8940", 58 - .stream_name = "WM8940", 59 - .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | 60 - SND_SOC_DAIFMT_CBS_CFS, 61 - .ops = &imote2_asoc_ops, 62 - SND_SOC_DAILINK_REG(wm8940), 63 - }; 64 - 65 - static struct snd_soc_card imote2 = { 66 - .name = "Imote2", 67 - .owner = THIS_MODULE, 68 - .dai_link = &imote2_dai, 69 - .num_links = 1, 70 - }; 71 - 72 - static int imote2_probe(struct platform_device *pdev) 73 - { 74 - struct snd_soc_card *card = &imote2; 75 - int ret; 76 - 77 - card->dev = &pdev->dev; 78 - 79 - ret = devm_snd_soc_register_card(&pdev->dev, card); 80 - if (ret) 81 - dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", 82 - ret); 83 - return ret; 84 - } 85 - 86 - static struct platform_driver imote2_driver = { 87 - .driver = { 88 - .name = "imote2-audio", 89 - .pm = &snd_soc_pm_ops, 90 - }, 91 - .probe = imote2_probe, 92 - }; 93 - 94 - module_platform_driver(imote2_driver); 95 - 96 - MODULE_AUTHOR("Jonathan Cameron"); 97 - MODULE_DESCRIPTION("ALSA SoC Imote 2"); 98 - MODULE_LICENSE("GPL"); 99 - MODULE_ALIAS("platform:imote2-audio");