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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'sh-for-linus' of git://github.com/pmundt/linux-sh

Pull SuperH fixes from Paul Mundt.

* tag 'sh-for-linus' of git://github.com/pmundt/linux-sh: (24 commits)
sh: explicitly include sh_dma.h in setup-sh7722.c
sh: ecovec: care CN5 VBUS if USB host mode
sh: sh7724: fixup renesas_usbhs clock settings
sh: intc: initial irqdomain support.
sh: pfc: Fix up init ordering mess.
serial: sh-sci: fix compilation breakage, when DMA is enabled
dmaengine: shdma: restore partial transfer calculation
sh: modify the sh_dmae_slave_config for RSPI in setup-sh7757
sh: Fix up recursive fault in oops with unset TTB.
sh: pfc: Build fix for pinctrl_remove_gpio_range() changes.
sh: select the fixed regulator driver on several boards
sh: ecovec: switch MMC power control to regulators
sh: add fixed voltage regulators to se7724
sh: add fixed voltage regulators to sdk7786
sh: add fixed voltage regulators to rsk
sh: add fixed voltage regulators to migor
sh: add fixed voltage regulators to kfr2r09
sh: add fixed voltage regulators to ap325rxa
sh: add fixed voltage regulators to sh7757lcr
sh: add fixed voltage regulators to sh2007
...

+419 -47
+13
arch/sh/boards/Kconfig
··· 57 57 depends on CPU_SUBTYPE_SH7724 58 58 select ARCH_REQUIRE_GPIOLIB 59 59 select SND_SOC_AK4642 if SND_SIMPLE_CARD 60 + select REGULATOR_FIXED_VOLTAGE if REGULATOR 60 61 help 61 62 Select 7724 SolutionEngine if configuring for a Hitachi SH7724 62 63 evaluation board. ··· 141 140 bool "Renesas Starter Kit" 142 141 depends on CPU_SUBTYPE_SH7201 || CPU_SUBTYPE_SH7203 || \ 143 142 CPU_SUBTYPE_SH7264 || CPU_SUBTYPE_SH7269 143 + select REGULATOR_FIXED_VOLTAGE if REGULATOR 144 144 help 145 145 Select this option if configuring for any of the RSK+ MCU 146 146 evaluation platforms. ··· 161 159 select NO_IOPORT if !PCI 162 160 select ARCH_WANT_OPTIONAL_GPIOLIB 163 161 select HAVE_SRAM_POOL 162 + select REGULATOR_FIXED_VOLTAGE if REGULATOR 164 163 help 165 164 Select SDK7786 if configuring for a Renesas Technology Europe 166 165 SH7786-65nm board. ··· 176 173 bool "SH7757LCR" 177 174 depends on CPU_SUBTYPE_SH7757 178 175 select ARCH_REQUIRE_GPIOLIB 176 + select REGULATOR_FIXED_VOLTAGE if REGULATOR 179 177 180 178 config SH_SH7785LCR 181 179 bool "SH7785LCR" ··· 210 206 bool "Migo-R" 211 207 depends on CPU_SUBTYPE_SH7722 212 208 select ARCH_REQUIRE_GPIOLIB 209 + select REGULATOR_FIXED_VOLTAGE if REGULATOR 213 210 help 214 211 Select Migo-R if configuring for the SH7722 Migo-R platform 215 212 by Renesas System Solutions Asia Pte. Ltd. ··· 219 214 bool "AP-325RXA" 220 215 depends on CPU_SUBTYPE_SH7723 221 216 select ARCH_REQUIRE_GPIOLIB 217 + select REGULATOR_FIXED_VOLTAGE if REGULATOR 222 218 help 223 219 Renesas "AP-325RXA" support. 224 220 Compatible with ALGO SYSTEM CO.,LTD. "AP-320A" ··· 228 222 bool "KFR2R09" 229 223 depends on CPU_SUBTYPE_SH7724 230 224 select ARCH_REQUIRE_GPIOLIB 225 + select REGULATOR_FIXED_VOLTAGE if REGULATOR 231 226 help 232 227 "Kit For R2R for 2009" support. 233 228 ··· 237 230 depends on CPU_SUBTYPE_SH7724 238 231 select ARCH_REQUIRE_GPIOLIB 239 232 select SND_SOC_DA7210 if SND_SIMPLE_CARD 233 + select REGULATOR_FIXED_VOLTAGE if REGULATOR 240 234 help 241 235 Renesas "R0P7724LC0011/21RL (EcoVec)" support. 242 236 ··· 313 305 bool "Magic Panel R2" 314 306 depends on CPU_SUBTYPE_SH7720 315 307 select ARCH_REQUIRE_GPIOLIB 308 + select REGULATOR_FIXED_VOLTAGE if REGULATOR 316 309 help 317 310 Select Magic Panel R2 if configuring for Magic Panel R2. 318 311 ··· 325 316 config SH_POLARIS 326 317 bool "SMSC Polaris" 327 318 select CPU_HAS_IPR_IRQ 319 + select REGULATOR_FIXED_VOLTAGE if REGULATOR 328 320 depends on CPU_SUBTYPE_SH7709 329 321 help 330 322 Select if configuring for an SMSC Polaris development board ··· 333 323 config SH_SH2007 334 324 bool "SH-2007 board" 335 325 select NO_IOPORT 326 + select REGULATOR_FIXED_VOLTAGE if REGULATOR 336 327 depends on CPU_SUBTYPE_SH7780 337 328 help 338 329 SH-2007 is a single-board computer based around SH7780 chip ··· 345 334 config SH_APSH4A3A 346 335 bool "AP-SH4A-3A" 347 336 select SH_ALPHA_BOARD 337 + select REGULATOR_FIXED_VOLTAGE if REGULATOR 348 338 depends on CPU_SUBTYPE_SH7785 349 339 help 350 340 Select AP-SH4A-3A if configuring for an ALPHAPROJECT AP-SH4A-3A. ··· 354 342 bool "AP-SH4AD-0A" 355 343 select SH_ALPHA_BOARD 356 344 select SYS_SUPPORTS_PCI 345 + select REGULATOR_FIXED_VOLTAGE if REGULATOR 357 346 depends on CPU_SUBTYPE_SH7786 358 347 help 359 348 Select AP-SH4AD-0A if configuring for an ALPHAPROJECT AP-SH4AD-0A.
+10
arch/sh/boards/board-apsh4a3a.c
··· 13 13 #include <linux/platform_device.h> 14 14 #include <linux/io.h> 15 15 #include <linux/mtd/physmap.h> 16 + #include <linux/regulator/fixed.h> 17 + #include <linux/regulator/machine.h> 16 18 #include <linux/smsc911x.h> 17 19 #include <linux/irq.h> 18 20 #include <linux/clk.h> ··· 68 66 .resource = nor_flash_resources, 69 67 }; 70 68 69 + /* Dummy supplies, where voltage doesn't matter */ 70 + static struct regulator_consumer_supply dummy_supplies[] = { 71 + REGULATOR_SUPPLY("vddvario", "smsc911x"), 72 + REGULATOR_SUPPLY("vdd33a", "smsc911x"), 73 + }; 74 + 71 75 static struct resource smsc911x_resources[] = { 72 76 [0] = { 73 77 .name = "smsc911x-memory", ··· 113 105 114 106 static int __init apsh4a3a_devices_setup(void) 115 107 { 108 + regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 109 + 116 110 return platform_add_devices(apsh4a3a_devices, 117 111 ARRAY_SIZE(apsh4a3a_devices)); 118 112 }
+10
arch/sh/boards/board-apsh4ad0a.c
··· 12 12 #include <linux/init.h> 13 13 #include <linux/platform_device.h> 14 14 #include <linux/io.h> 15 + #include <linux/regulator/fixed.h> 16 + #include <linux/regulator/machine.h> 15 17 #include <linux/smsc911x.h> 16 18 #include <linux/irq.h> 17 19 #include <linux/clk.h> 18 20 #include <asm/machvec.h> 19 21 #include <asm/sizes.h> 22 + 23 + /* Dummy supplies, where voltage doesn't matter */ 24 + static struct regulator_consumer_supply dummy_supplies[] = { 25 + REGULATOR_SUPPLY("vddvario", "smsc911x"), 26 + REGULATOR_SUPPLY("vdd33a", "smsc911x"), 27 + }; 20 28 21 29 static struct resource smsc911x_resources[] = { 22 30 [0] = { ··· 64 56 65 57 static int __init apsh4ad0a_devices_setup(void) 66 58 { 59 + regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 60 + 67 61 return platform_add_devices(apsh4ad0a_devices, 68 62 ARRAY_SIZE(apsh4ad0a_devices)); 69 63 }
+10
arch/sh/boards/board-magicpanelr2.c
··· 14 14 #include <linux/platform_device.h> 15 15 #include <linux/delay.h> 16 16 #include <linux/gpio.h> 17 + #include <linux/regulator/fixed.h> 18 + #include <linux/regulator/machine.h> 17 19 #include <linux/smsc911x.h> 18 20 #include <linux/mtd/mtd.h> 19 21 #include <linux/mtd/partitions.h> ··· 25 23 #include <mach/magicpanelr2.h> 26 24 #include <asm/heartbeat.h> 27 25 #include <cpu/sh7720.h> 26 + 27 + /* Dummy supplies, where voltage doesn't matter */ 28 + static struct regulator_consumer_supply dummy_supplies[] = { 29 + REGULATOR_SUPPLY("vddvario", "smsc911x"), 30 + REGULATOR_SUPPLY("vdd33a", "smsc911x"), 31 + }; 28 32 29 33 #define LAN9115_READY (__raw_readl(0xA8000084UL) & 0x00000001UL) 30 34 ··· 356 348 357 349 static int __init mpr2_devices_setup(void) 358 350 { 351 + regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 352 + 359 353 return platform_add_devices(mpr2_devices, ARRAY_SIZE(mpr2_devices)); 360 354 } 361 355 device_initcall(mpr2_devices_setup);
+10
arch/sh/boards/board-polaris.c
··· 9 9 #include <linux/interrupt.h> 10 10 #include <linux/irq.h> 11 11 #include <linux/platform_device.h> 12 + #include <linux/regulator/fixed.h> 13 + #include <linux/regulator/machine.h> 12 14 #include <linux/smsc911x.h> 13 15 #include <linux/io.h> 14 16 #include <asm/irq.h> ··· 23 21 #define WCR2 (0xFFFFFF66) 24 22 #define AREA5_WAIT_CTRL (0x1C00) 25 23 #define WAIT_STATES_10 (0x7) 24 + 25 + /* Dummy supplies, where voltage doesn't matter */ 26 + static struct regulator_consumer_supply dummy_supplies[] = { 27 + REGULATOR_SUPPLY("vddvario", "smsc911x.0"), 28 + REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), 29 + }; 26 30 27 31 static struct resource smsc911x_resources[] = { 28 32 [0] = { ··· 95 87 u16 wcr, bcr_mask; 96 88 97 89 printk(KERN_INFO "Configuring Polaris external bus\n"); 90 + 91 + regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 98 92 99 93 /* Configure area 5 with 2 wait states */ 100 94 wcr = __raw_readw(WCR2);
+12
arch/sh/boards/board-sh2007.c
··· 6 6 */ 7 7 #include <linux/init.h> 8 8 #include <linux/irq.h> 9 + #include <linux/regulator/fixed.h> 10 + #include <linux/regulator/machine.h> 9 11 #include <linux/smsc911x.h> 10 12 #include <linux/platform_device.h> 11 13 #include <linux/ata_platform.h> 12 14 #include <linux/io.h> 13 15 #include <asm/machvec.h> 14 16 #include <mach/sh2007.h> 17 + 18 + /* Dummy supplies, where voltage doesn't matter */ 19 + static struct regulator_consumer_supply dummy_supplies[] = { 20 + REGULATOR_SUPPLY("vddvario", "smsc911x.0"), 21 + REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), 22 + REGULATOR_SUPPLY("vddvario", "smsc911x.1"), 23 + REGULATOR_SUPPLY("vdd33a", "smsc911x.1"), 24 + }; 15 25 16 26 struct smsc911x_platform_config smc911x_info = { 17 27 .flags = SMSC911X_USE_32BIT, ··· 108 98 109 99 static int __init sh2007_io_init(void) 110 100 { 101 + regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 102 + 111 103 platform_add_devices(sh2007_devices, ARRAY_SIZE(sh2007_devices)); 112 104 return 0; 113 105 }
+14
arch/sh/boards/board-sh7757lcr.c
··· 12 12 #include <linux/platform_device.h> 13 13 #include <linux/gpio.h> 14 14 #include <linux/irq.h> 15 + #include <linux/regulator/fixed.h> 16 + #include <linux/regulator/machine.h> 15 17 #include <linux/spi/spi.h> 16 18 #include <linux/spi/flash.h> 17 19 #include <linux/io.h> ··· 201 199 }, 202 200 }; 203 201 202 + /* Fixed 3.3V regulator to be used by SDHI0, MMCIF */ 203 + static struct regulator_consumer_supply fixed3v3_power_consumers[] = 204 + { 205 + REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), 206 + REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"), 207 + REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"), 208 + REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"), 209 + }; 210 + 204 211 /* SH_MMCIF */ 205 212 static struct resource sh_mmcif_resources[] = { 206 213 [0] = { ··· 340 329 341 330 static int __init sh7757lcr_devices_setup(void) 342 331 { 332 + regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers, 333 + ARRAY_SIZE(fixed3v3_power_consumers), 3300000); 334 + 343 335 /* RGMII (PTA) */ 344 336 gpio_request(GPIO_FN_ET0_MDC, NULL); 345 337 gpio_request(GPIO_FN_ET0_MDIO, NULL);
+21
arch/sh/boards/mach-ap325rxa/setup.c
··· 20 20 #include <linux/mtd/sh_flctl.h> 21 21 #include <linux/delay.h> 22 22 #include <linux/i2c.h> 23 + #include <linux/regulator/fixed.h> 24 + #include <linux/regulator/machine.h> 23 25 #include <linux/smsc911x.h> 24 26 #include <linux/gpio.h> 25 27 #include <linux/videodev2.h> ··· 35 33 #include <asm/clock.h> 36 34 #include <asm/suspend.h> 37 35 #include <cpu/sh7723.h> 36 + 37 + /* Dummy supplies, where voltage doesn't matter */ 38 + static struct regulator_consumer_supply dummy_supplies[] = { 39 + REGULATOR_SUPPLY("vddvario", "smsc911x"), 40 + REGULATOR_SUPPLY("vdd33a", "smsc911x"), 41 + }; 38 42 39 43 static struct smsc911x_platform_config smsc911x_config = { 40 44 .phy_interface = PHY_INTERFACE_MODE_MII, ··· 431 423 }, 432 424 }; 433 425 426 + /* Fixed 3.3V regulators to be used by SDHI0, SDHI1 */ 427 + static struct regulator_consumer_supply fixed3v3_power_consumers[] = 428 + { 429 + REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), 430 + REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"), 431 + REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"), 432 + REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"), 433 + }; 434 + 434 435 static struct resource sdhi0_cn3_resources[] = { 435 436 [0] = { 436 437 .name = "SDHI0", ··· 560 543 &ap325rxa_sdram_enter_end, 561 544 &ap325rxa_sdram_leave_start, 562 545 &ap325rxa_sdram_leave_end); 546 + 547 + regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers, 548 + ARRAY_SIZE(fixed3v3_power_consumers), 3300000); 549 + regulator_register_fixed(1, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 563 550 564 551 /* LD3 and LD4 LEDs */ 565 552 gpio_request(GPIO_PTX5, NULL); /* RUN */
+108 -17
arch/sh/boards/mach-ecovec24/setup.c
··· 19 19 #include <linux/interrupt.h> 20 20 #include <linux/io.h> 21 21 #include <linux/delay.h> 22 + #include <linux/regulator/fixed.h> 23 + #include <linux/regulator/machine.h> 22 24 #include <linux/usb/r8a66597.h> 23 25 #include <linux/usb/renesas_usbhs.h> 24 26 #include <linux/i2c.h> ··· 244 242 return gpio_get_value(GPIO_PTB3); 245 243 } 246 244 245 + static void usbhs_phy_reset(struct platform_device *pdev) 246 + { 247 + /* enable vbus if HOST */ 248 + if (!gpio_get_value(GPIO_PTB3)) 249 + gpio_set_value(GPIO_PTB5, 1); 250 + } 251 + 247 252 static struct renesas_usbhs_platform_info usbhs_info = { 248 253 .platform_callback = { 249 254 .get_id = usbhs_get_id, 255 + .phy_reset = usbhs_phy_reset, 250 256 }, 251 257 .driver_param = { 252 258 .buswait_bwait = 4, ··· 528 518 .irq = IRQ0, 529 519 }; 530 520 521 + static struct regulator_consumer_supply cn12_power_consumers[] = 522 + { 523 + REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"), 524 + REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"), 525 + REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"), 526 + REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"), 527 + }; 528 + 529 + static struct regulator_init_data cn12_power_init_data = { 530 + .constraints = { 531 + .valid_ops_mask = REGULATOR_CHANGE_STATUS, 532 + }, 533 + .num_consumer_supplies = ARRAY_SIZE(cn12_power_consumers), 534 + .consumer_supplies = cn12_power_consumers, 535 + }; 536 + 537 + static struct fixed_voltage_config cn12_power_info = { 538 + .supply_name = "CN12 SD/MMC Vdd", 539 + .microvolts = 3300000, 540 + .gpio = GPIO_PTB7, 541 + .enable_high = 1, 542 + .init_data = &cn12_power_init_data, 543 + }; 544 + 545 + static struct platform_device cn12_power = { 546 + .name = "reg-fixed-voltage", 547 + .id = 0, 548 + .dev = { 549 + .platform_data = &cn12_power_info, 550 + }, 551 + }; 552 + 531 553 #if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) 532 554 /* SDHI0 */ 555 + static struct regulator_consumer_supply sdhi0_power_consumers[] = 556 + { 557 + REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), 558 + REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"), 559 + }; 560 + 561 + static struct regulator_init_data sdhi0_power_init_data = { 562 + .constraints = { 563 + .valid_ops_mask = REGULATOR_CHANGE_STATUS, 564 + }, 565 + .num_consumer_supplies = ARRAY_SIZE(sdhi0_power_consumers), 566 + .consumer_supplies = sdhi0_power_consumers, 567 + }; 568 + 569 + static struct fixed_voltage_config sdhi0_power_info = { 570 + .supply_name = "CN11 SD/MMC Vdd", 571 + .microvolts = 3300000, 572 + .gpio = GPIO_PTB6, 573 + .enable_high = 1, 574 + .init_data = &sdhi0_power_init_data, 575 + }; 576 + 577 + static struct platform_device sdhi0_power = { 578 + .name = "reg-fixed-voltage", 579 + .id = 1, 580 + .dev = { 581 + .platform_data = &sdhi0_power_info, 582 + }, 583 + }; 584 + 533 585 static void sdhi0_set_pwr(struct platform_device *pdev, int state) 534 586 { 587 + static int power_gpio = -EINVAL; 588 + 589 + if (power_gpio < 0) { 590 + int ret = gpio_request(GPIO_PTB6, NULL); 591 + if (!ret) { 592 + power_gpio = GPIO_PTB6; 593 + gpio_direction_output(power_gpio, 0); 594 + } 595 + } 596 + 597 + /* 598 + * Toggle the GPIO regardless, whether we managed to grab it above or 599 + * the fixed regulator driver did. 600 + */ 535 601 gpio_set_value(GPIO_PTB6, state); 536 602 } 537 603 ··· 648 562 }, 649 563 }; 650 564 651 - #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) 652 - /* SDHI1 */ 653 - static void sdhi1_set_pwr(struct platform_device *pdev, int state) 565 + static void cn12_set_pwr(struct platform_device *pdev, int state) 654 566 { 567 + static int power_gpio = -EINVAL; 568 + 569 + if (power_gpio < 0) { 570 + int ret = gpio_request(GPIO_PTB7, NULL); 571 + if (!ret) { 572 + power_gpio = GPIO_PTB7; 573 + gpio_direction_output(power_gpio, 0); 574 + } 575 + } 576 + 577 + /* 578 + * Toggle the GPIO regardless, whether we managed to grab it above or 579 + * the fixed regulator driver did. 580 + */ 655 581 gpio_set_value(GPIO_PTB7, state); 656 582 } 657 583 584 + #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) 585 + /* SDHI1 */ 658 586 static int sdhi1_get_cd(struct platform_device *pdev) 659 587 { 660 588 return !gpio_get_value(GPIO_PTW7); ··· 679 579 .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX, 680 580 .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD | 681 581 MMC_CAP_NEEDS_POLL, 682 - .set_pwr = sdhi1_set_pwr, 582 + .set_pwr = cn12_set_pwr, 683 583 .get_cd = sdhi1_get_cd, 684 584 }; 685 585 ··· 999 899 1000 900 #if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE) 1001 901 /* SH_MMCIF */ 1002 - static void mmcif_set_pwr(struct platform_device *pdev, int state) 1003 - { 1004 - gpio_set_value(GPIO_PTB7, state); 1005 - } 1006 - 1007 902 static void mmcif_down_pwr(struct platform_device *pdev) 1008 903 { 1009 - gpio_set_value(GPIO_PTB7, 0); 904 + cn12_set_pwr(pdev, 0); 1010 905 } 1011 906 1012 907 static struct resource sh_mmcif_resources[] = { ··· 1024 929 }; 1025 930 1026 931 static struct sh_mmcif_plat_data sh_mmcif_plat = { 1027 - .set_pwr = mmcif_set_pwr, 932 + .set_pwr = cn12_set_pwr, 1028 933 .down_pwr = mmcif_down_pwr, 1029 934 .sup_pclk = 0, /* SH7724: Max Pclk/2 */ 1030 935 .caps = MMC_CAP_4_BIT_DATA | ··· 1055 960 &ceu0_device, 1056 961 &ceu1_device, 1057 962 &keysc_device, 963 + &cn12_power, 1058 964 #if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) 965 + &sdhi0_power, 1059 966 &sdhi0_device, 1060 967 #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) 1061 968 &sdhi1_device, ··· 1355 1258 gpio_request(GPIO_FN_SDHI0D2, NULL); 1356 1259 gpio_request(GPIO_FN_SDHI0D1, NULL); 1357 1260 gpio_request(GPIO_FN_SDHI0D0, NULL); 1358 - gpio_request(GPIO_PTB6, NULL); 1359 - gpio_direction_output(GPIO_PTB6, 0); 1360 1261 #else 1361 1262 /* enable MSIOF0 on CN11 (needs DS2.4 set to OFF) */ 1362 1263 gpio_request(GPIO_FN_MSIOF0_TXD, NULL); ··· 1383 1288 gpio_request(GPIO_FN_MMC_D0, NULL); 1384 1289 gpio_request(GPIO_FN_MMC_CLK, NULL); 1385 1290 gpio_request(GPIO_FN_MMC_CMD, NULL); 1386 - gpio_request(GPIO_PTB7, NULL); 1387 - gpio_direction_output(GPIO_PTB7, 0); 1388 1291 1389 1292 cn12_enabled = true; 1390 1293 #elif defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) ··· 1394 1301 gpio_request(GPIO_FN_SDHI1D2, NULL); 1395 1302 gpio_request(GPIO_FN_SDHI1D1, NULL); 1396 1303 gpio_request(GPIO_FN_SDHI1D0, NULL); 1397 - gpio_request(GPIO_PTB7, NULL); 1398 - gpio_direction_output(GPIO_PTB7, 0); 1399 1304 1400 1305 /* Card-detect, used on CN12 with SDHI1 */ 1401 1306 gpio_request(GPIO_PTW7, NULL);
+12
arch/sh/boards/mach-kfr2r09/setup.c
··· 21 21 #include <linux/input.h> 22 22 #include <linux/input/sh_keysc.h> 23 23 #include <linux/i2c.h> 24 + #include <linux/regulator/fixed.h> 25 + #include <linux/regulator/machine.h> 24 26 #include <linux/usb/r8a66597.h> 25 27 #include <linux/videodev2.h> 26 28 #include <linux/sh_intc.h> ··· 343 341 }, 344 342 }; 345 343 344 + /* Fixed 3.3V regulator to be used by SDHI0 */ 345 + static struct regulator_consumer_supply fixed3v3_power_consumers[] = 346 + { 347 + REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), 348 + REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"), 349 + }; 350 + 346 351 static struct resource kfr2r09_sh_sdhi0_resources[] = { 347 352 [0] = { 348 353 .name = "SDHI0", ··· 531 522 &kfr2r09_sdram_enter_end, 532 523 &kfr2r09_sdram_leave_start, 533 524 &kfr2r09_sdram_leave_end); 525 + 526 + regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers, 527 + ARRAY_SIZE(fixed3v3_power_consumers), 3300000); 534 528 535 529 /* enable SCIF1 serial port for YC401 console support */ 536 530 gpio_request(GPIO_FN_SCIF1_RXD, NULL);
+13
arch/sh/boards/mach-migor/setup.c
··· 17 17 #include <linux/mtd/physmap.h> 18 18 #include <linux/mtd/nand.h> 19 19 #include <linux/i2c.h> 20 + #include <linux/regulator/fixed.h> 21 + #include <linux/regulator/machine.h> 20 22 #include <linux/smc91x.h> 21 23 #include <linux/delay.h> 22 24 #include <linux/clk.h> ··· 388 386 }, 389 387 }; 390 388 389 + /* Fixed 3.3V regulator to be used by SDHI0 */ 390 + static struct regulator_consumer_supply fixed3v3_power_consumers[] = 391 + { 392 + REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), 393 + REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"), 394 + }; 395 + 391 396 static struct resource sdhi_cn9_resources[] = { 392 397 [0] = { 393 398 .name = "SDHI", ··· 507 498 &migor_sdram_enter_end, 508 499 &migor_sdram_leave_start, 509 500 &migor_sdram_leave_end); 501 + 502 + regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers, 503 + ARRAY_SIZE(fixed3v3_power_consumers), 3300000); 504 + 510 505 /* Let D11 LED show STATUS0 */ 511 506 gpio_request(GPIO_FN_STATUS0, NULL); 512 507
+10
arch/sh/boards/mach-rsk/setup.c
··· 16 16 #include <linux/mtd/partitions.h> 17 17 #include <linux/mtd/physmap.h> 18 18 #include <linux/mtd/map.h> 19 + #include <linux/regulator/fixed.h> 20 + #include <linux/regulator/machine.h> 19 21 #include <asm/machvec.h> 20 22 #include <asm/io.h> 23 + 24 + /* Dummy supplies, where voltage doesn't matter */ 25 + static struct regulator_consumer_supply dummy_supplies[] = { 26 + REGULATOR_SUPPLY("vddvario", "smsc911x"), 27 + REGULATOR_SUPPLY("vdd33a", "smsc911x"), 28 + }; 21 29 22 30 static const char *part_probes[] = { "cmdlinepart", NULL }; 23 31 ··· 75 67 76 68 static int __init rsk_devices_setup(void) 77 69 { 70 + regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 71 + 78 72 return platform_add_devices(rsk_devices, 79 73 ARRAY_SIZE(rsk_devices)); 80 74 }
+10
arch/sh/boards/mach-sdk7786/setup.c
··· 11 11 #include <linux/init.h> 12 12 #include <linux/platform_device.h> 13 13 #include <linux/io.h> 14 + #include <linux/regulator/fixed.h> 15 + #include <linux/regulator/machine.h> 14 16 #include <linux/smsc911x.h> 15 17 #include <linux/i2c.h> 16 18 #include <linux/irq.h> ··· 38 36 .id = -1, 39 37 .num_resources = 1, 40 38 .resource = &heartbeat_resource, 39 + }; 40 + 41 + /* Dummy supplies, where voltage doesn't matter */ 42 + static struct regulator_consumer_supply dummy_supplies[] = { 43 + REGULATOR_SUPPLY("vddvario", "smsc911x"), 44 + REGULATOR_SUPPLY("vdd33a", "smsc911x"), 41 45 }; 42 46 43 47 static struct resource smsc911x_resources[] = { ··· 243 235 static void __init sdk7786_setup(char **cmdline_p) 244 236 { 245 237 pr_info("Renesas Technology Europe SDK7786 support:\n"); 238 + 239 + regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 246 240 247 241 sdk7786_fpga_init(); 248 242 sdk7786_nmi_init();
+15
arch/sh/boards/mach-se/7724/setup.c
··· 18 18 #include <linux/mmc/sh_mobile_sdhi.h> 19 19 #include <linux/mtd/physmap.h> 20 20 #include <linux/delay.h> 21 + #include <linux/regulator/fixed.h> 22 + #include <linux/regulator/machine.h> 21 23 #include <linux/smc91x.h> 22 24 #include <linux/gpio.h> 23 25 #include <linux/input.h> ··· 456 454 .resource = sh7724_usb1_gadget_resources, 457 455 }; 458 456 457 + /* Fixed 3.3V regulator to be used by SDHI0, SDHI1 */ 458 + static struct regulator_consumer_supply fixed3v3_power_consumers[] = 459 + { 460 + REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), 461 + REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"), 462 + REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"), 463 + REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"), 464 + }; 465 + 459 466 static struct resource sdhi0_cn7_resources[] = { 460 467 [0] = { 461 468 .name = "SDHI0", ··· 695 684 &ms7724se_sdram_enter_end, 696 685 &ms7724se_sdram_leave_start, 697 686 &ms7724se_sdram_leave_end); 687 + 688 + regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers, 689 + ARRAY_SIZE(fixed3v3_power_consumers), 3300000); 690 + 698 691 /* Reset Release */ 699 692 fpga_out = __raw_readw(FPGA_OUT); 700 693 /* bit4: NTSC_PDN, bit5: NTSC_RESET */
+2
arch/sh/include/cpu-sh4/cpu/sh7757.h
··· 283 283 SHDMA_SLAVE_RIIC8_RX, 284 284 SHDMA_SLAVE_RIIC9_TX, 285 285 SHDMA_SLAVE_RIIC9_RX, 286 + SHDMA_SLAVE_RSPI_TX, 287 + SHDMA_SLAVE_RSPI_RX, 286 288 }; 287 289 #endif /* __ASM_SH7757_H__ */
+2 -2
arch/sh/kernel/cpu/sh4a/clock-sh7724.c
··· 334 334 CLKDEV_CON_ID("tpu0", &mstp_clks[HWBLK_TPU]), 335 335 CLKDEV_CON_ID("irda0", &mstp_clks[HWBLK_IRDA]), 336 336 CLKDEV_CON_ID("tsif0", &mstp_clks[HWBLK_TSIF]), 337 - CLKDEV_CON_ID("usb1", &mstp_clks[HWBLK_USB1]), 338 - CLKDEV_CON_ID("usb0", &mstp_clks[HWBLK_USB0]), 337 + CLKDEV_DEV_ID("renesas_usbhs.1", &mstp_clks[HWBLK_USB1]), 338 + CLKDEV_DEV_ID("renesas_usbhs.0", &mstp_clks[HWBLK_USB0]), 339 339 CLKDEV_CON_ID("2dg0", &mstp_clks[HWBLK_2DG]), 340 340 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[HWBLK_SDHI0]), 341 341 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[HWBLK_SDHI1]),
+1
arch/sh/kernel/cpu/sh4a/setup-sh7722.c
··· 12 12 #include <linux/platform_device.h> 13 13 #include <linux/serial.h> 14 14 #include <linux/serial_sci.h> 15 + #include <linux/sh_dma.h> 15 16 #include <linux/sh_timer.h> 16 17 #include <linux/sh_intc.h> 17 18 #include <linux/uio_driver.h>
+14
arch/sh/kernel/cpu/sh4a/setup-sh7757.c
··· 216 216 TS_INDEX2VAL(XMIT_SZ_8BIT), 217 217 .mid_rid = 0x42, 218 218 }, 219 + { 220 + .slave_id = SHDMA_SLAVE_RSPI_TX, 221 + .addr = 0xfe480004, 222 + .chcr = SM_INC | 0x800 | 0x40000000 | 223 + TS_INDEX2VAL(XMIT_SZ_16BIT), 224 + .mid_rid = 0xc1, 225 + }, 226 + { 227 + .slave_id = SHDMA_SLAVE_RSPI_RX, 228 + .addr = 0xfe480004, 229 + .chcr = DM_INC | 0x800 | 0x40000000 | 230 + TS_INDEX2VAL(XMIT_SZ_16BIT), 231 + .mid_rid = 0xc2, 232 + }, 219 233 }; 220 234 221 235 static const struct sh_dmae_slave_config sh7757_dmae2_slaves[] = {
+6 -2
arch/sh/mm/fault.c
··· 58 58 { 59 59 pgd_t *pgd; 60 60 61 - if (mm) 61 + if (mm) { 62 62 pgd = mm->pgd; 63 - else 63 + } else { 64 64 pgd = get_TTB(); 65 + 66 + if (unlikely(!pgd)) 67 + pgd = swapper_pg_dir; 68 + } 65 69 66 70 printk(KERN_ALERT "pgd = %p\n", pgd); 67 71 pgd += pgd_index(addr);
+9
drivers/dma/sh/shdma-base.c
··· 483 483 new->mark = DESC_PREPARED; 484 484 new->async_tx.flags = flags; 485 485 new->direction = direction; 486 + new->partial = 0; 486 487 487 488 *len -= copy_size; 488 489 if (direction == DMA_MEM_TO_MEM || direction == DMA_MEM_TO_DEV) ··· 645 644 case DMA_TERMINATE_ALL: 646 645 spin_lock_irqsave(&schan->chan_lock, flags); 647 646 ops->halt_channel(schan); 647 + 648 + if (ops->get_partial && !list_empty(&schan->ld_queue)) { 649 + /* Record partial transfer */ 650 + struct shdma_desc *desc = list_first_entry(&schan->ld_queue, 651 + struct shdma_desc, node); 652 + desc->partial = ops->get_partial(schan, desc); 653 + } 654 + 648 655 spin_unlock_irqrestore(&schan->chan_lock, flags); 649 656 650 657 shdma_chan_ld_cleanup(schan, true);
+12
drivers/dma/sh/shdma.c
··· 381 381 return true; 382 382 } 383 383 384 + static size_t sh_dmae_get_partial(struct shdma_chan *schan, 385 + struct shdma_desc *sdesc) 386 + { 387 + struct sh_dmae_chan *sh_chan = container_of(schan, struct sh_dmae_chan, 388 + shdma_chan); 389 + struct sh_dmae_desc *sh_desc = container_of(sdesc, 390 + struct sh_dmae_desc, shdma_desc); 391 + return (sh_desc->hw.tcr - sh_dmae_readl(sh_chan, TCR)) << 392 + sh_chan->xmit_shift; 393 + } 394 + 384 395 /* Called from error IRQ or NMI */ 385 396 static bool sh_dmae_reset(struct sh_dmae_device *shdev) 386 397 { ··· 643 632 .start_xfer = sh_dmae_start_xfer, 644 633 .embedded_desc = sh_dmae_embedded_desc, 645 634 .chan_irq = sh_dmae_chan_irq, 635 + .get_partial = sh_dmae_get_partial, 646 636 }; 647 637 648 638 static int __devinit sh_dmae_probe(struct platform_device *pdev)
+4
drivers/sh/intc/Kconfig
··· 1 + config SH_INTC 2 + def_bool y 3 + select IRQ_DOMAIN 4 + 1 5 comment "Interrupt controller options" 2 6 3 7 config INTC_USERIMASK
+1 -1
drivers/sh/intc/Makefile
··· 1 - obj-y := access.o chip.o core.o handle.o virq.o 1 + obj-y := access.o chip.o core.o handle.o irqdomain.o virq.o 2 2 3 3 obj-$(CONFIG_INTC_BALANCING) += balancing.o 4 4 obj-$(CONFIG_INTC_USERIMASK) += userimask.o
+7 -4
drivers/sh/intc/core.c
··· 25 25 #include <linux/stat.h> 26 26 #include <linux/interrupt.h> 27 27 #include <linux/sh_intc.h> 28 + #include <linux/irqdomain.h> 28 29 #include <linux/device.h> 29 30 #include <linux/syscore_ops.h> 30 31 #include <linux/list.h> ··· 311 310 312 311 BUG_ON(k > 256); /* _INTC_ADDR_E() and _INTC_ADDR_D() are 8 bits */ 313 312 313 + intc_irq_domain_init(d, hw); 314 + 314 315 /* register the vectors one by one */ 315 316 for (i = 0; i < hw->nr_vectors; i++) { 316 317 struct intc_vect *vect = hw->vectors + i; ··· 322 319 if (!vect->enum_id) 323 320 continue; 324 321 325 - res = irq_alloc_desc_at(irq, numa_node_id()); 326 - if (res != irq && res != -EEXIST) { 322 + res = irq_create_identity_mapping(d->domain, irq); 323 + if (unlikely(res)) { 327 324 pr_err("can't get irq_desc for %d\n", irq); 328 325 continue; 329 326 } ··· 343 340 * IRQ support, each vector still needs to have 344 341 * its own backing irq_desc. 345 342 */ 346 - res = irq_alloc_desc_at(irq2, numa_node_id()); 347 - if (res != irq2 && res != -EEXIST) { 343 + res = irq_create_identity_mapping(d->domain, irq2); 344 + if (unlikely(res)) { 348 345 pr_err("can't get irq_desc for %d\n", irq2); 349 346 continue; 350 347 }
+5
drivers/sh/intc/internals.h
··· 1 1 #include <linux/sh_intc.h> 2 2 #include <linux/irq.h> 3 + #include <linux/irqdomain.h> 3 4 #include <linux/list.h> 4 5 #include <linux/kernel.h> 5 6 #include <linux/types.h> ··· 67 66 unsigned int nr_sense; 68 67 struct intc_window *window; 69 68 unsigned int nr_windows; 69 + struct irq_domain *domain; 70 70 struct irq_chip chip; 71 71 bool skip_suspend; 72 72 }; ··· 188 186 unsigned long intc_get_ack_handle(unsigned int irq); 189 187 void intc_enable_disable_enum(struct intc_desc *desc, struct intc_desc_int *d, 190 188 intc_enum enum_id, int enable); 189 + 190 + /* irqdomain.c */ 191 + void intc_irq_domain_init(struct intc_desc_int *d, struct intc_hw_desc *hw); 191 192 192 193 /* virq.c */ 193 194 void intc_subgroup_init(struct intc_desc *desc, struct intc_desc_int *d);
+68
drivers/sh/intc/irqdomain.c
··· 1 + /* 2 + * IRQ domain support for SH INTC subsystem 3 + * 4 + * Copyright (C) 2012 Paul Mundt 5 + * 6 + * This file is subject to the terms and conditions of the GNU General Public 7 + * License. See the file "COPYING" in the main directory of this archive 8 + * for more details. 9 + */ 10 + #define pr_fmt(fmt) "intc: " fmt 11 + 12 + #include <linux/irqdomain.h> 13 + #include <linux/sh_intc.h> 14 + #include <linux/export.h> 15 + #include "internals.h" 16 + 17 + /** 18 + * intc_irq_domain_evt_xlate() - Generic xlate for vectored IRQs. 19 + * 20 + * This takes care of exception vector to hwirq translation through 21 + * by way of evt2irq() translation. 22 + * 23 + * Note: For platforms that use a flat vector space without INTEVT this 24 + * basically just mimics irq_domain_xlate_onecell() by way of a nopped 25 + * out evt2irq() implementation. 26 + */ 27 + static int intc_evt_xlate(struct irq_domain *d, struct device_node *ctrlr, 28 + const u32 *intspec, unsigned int intsize, 29 + unsigned long *out_hwirq, unsigned int *out_type) 30 + { 31 + if (WARN_ON(intsize < 1)) 32 + return -EINVAL; 33 + 34 + *out_hwirq = evt2irq(intspec[0]); 35 + *out_type = IRQ_TYPE_NONE; 36 + 37 + return 0; 38 + } 39 + 40 + static const struct irq_domain_ops intc_evt_ops = { 41 + .xlate = intc_evt_xlate, 42 + }; 43 + 44 + void __init intc_irq_domain_init(struct intc_desc_int *d, 45 + struct intc_hw_desc *hw) 46 + { 47 + unsigned int irq_base, irq_end; 48 + 49 + /* 50 + * Quick linear revmap check 51 + */ 52 + irq_base = evt2irq(hw->vectors[0].vect); 53 + irq_end = evt2irq(hw->vectors[hw->nr_vectors - 1].vect); 54 + 55 + /* 56 + * Linear domains have a hard-wired assertion that IRQs start at 57 + * 0 in order to make some performance optimizations. Lamely 58 + * restrict the linear case to these conditions here, taking the 59 + * tree penalty for linear cases with non-zero hwirq bases. 60 + */ 61 + if (irq_base == 0 && irq_end == (irq_base + hw->nr_vectors - 1)) 62 + d->domain = irq_domain_add_linear(NULL, hw->nr_vectors, 63 + &intc_evt_ops, NULL); 64 + else 65 + d->domain = irq_domain_add_tree(NULL, &intc_evt_ops, NULL); 66 + 67 + BUG_ON(!d->domain); 68 + }
+15 -19
drivers/sh/pfc/pinctrl.c
··· 276 276 unsigned long config) 277 277 { 278 278 struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); 279 - struct sh_pfc *pfc = pmx->pfc; 280 279 281 280 /* Validate the new type */ 282 281 if (config >= PINMUX_FLAG_TYPE) ··· 324 325 .pmxops = &sh_pfc_pinmux_ops, 325 326 .confops = &sh_pfc_pinconf_ops, 326 327 }; 327 - 328 - int sh_pfc_register_pinctrl(struct sh_pfc *pfc) 329 - { 330 - sh_pfc_pmx = kzalloc(sizeof(struct sh_pfc_pinctrl), GFP_KERNEL); 331 - if (unlikely(!sh_pfc_pmx)) 332 - return -ENOMEM; 333 - 334 - spin_lock_init(&sh_pfc_pmx->lock); 335 - 336 - sh_pfc_pmx->pfc = pfc; 337 - 338 - return 0; 339 - } 340 - EXPORT_SYMBOL_GPL(sh_pfc_register_pinctrl); 341 328 342 329 static inline void __devinit sh_pfc_map_one_gpio(struct sh_pfc *pfc, 343 330 struct sh_pfc_pinctrl *pmx, ··· 466 481 { 467 482 struct sh_pfc_pinctrl *pmx = platform_get_drvdata(pdev); 468 483 469 - pinctrl_remove_gpio_range(pmx->pctl, &sh_pfc_gpio_range); 470 484 pinctrl_unregister(pmx->pctl); 471 485 472 486 platform_set_drvdata(pdev, NULL); ··· 491 507 .id = -1, 492 508 }; 493 509 494 - static int __init sh_pfc_pinctrl_init(void) 510 + static int sh_pfc_pinctrl_init(void) 495 511 { 496 512 int rc; 497 513 ··· 505 521 return rc; 506 522 } 507 523 524 + int sh_pfc_register_pinctrl(struct sh_pfc *pfc) 525 + { 526 + sh_pfc_pmx = kzalloc(sizeof(struct sh_pfc_pinctrl), GFP_KERNEL); 527 + if (unlikely(!sh_pfc_pmx)) 528 + return -ENOMEM; 529 + 530 + spin_lock_init(&sh_pfc_pmx->lock); 531 + 532 + sh_pfc_pmx->pfc = pfc; 533 + 534 + return sh_pfc_pinctrl_init(); 535 + } 536 + EXPORT_SYMBOL_GPL(sh_pfc_register_pinctrl); 537 + 508 538 static void __exit sh_pfc_pinctrl_exit(void) 509 539 { 510 540 platform_driver_unregister(&sh_pfc_pinctrl_driver); 511 541 } 512 - 513 - subsys_initcall(sh_pfc_pinctrl_init); 514 542 module_exit(sh_pfc_pinctrl_exit);
+3 -2
drivers/tty/serial/sh-sci.c
··· 25 25 26 26 #include <linux/module.h> 27 27 #include <linux/errno.h> 28 + #include <linux/sh_dma.h> 28 29 #include <linux/timer.h> 29 30 #include <linux/interrupt.h> 30 31 #include <linux/tty.h> ··· 1411 1410 /* Handle incomplete DMA receive */ 1412 1411 struct tty_struct *tty = port->state->port.tty; 1413 1412 struct dma_chan *chan = s->chan_rx; 1414 - struct sh_desc *sh_desc = container_of(desc, struct sh_desc, 1415 - async_tx); 1413 + struct shdma_desc *sh_desc = container_of(desc, 1414 + struct shdma_desc, async_tx); 1416 1415 unsigned long flags; 1417 1416 int count; 1418 1417
+2
include/linux/shdma-base.h
··· 50 50 struct list_head node; 51 51 struct dma_async_tx_descriptor async_tx; 52 52 enum dma_transfer_direction direction; 53 + size_t partial; 53 54 dma_cookie_t cookie; 54 55 int chunks; 55 56 int mark; ··· 99 98 void (*start_xfer)(struct shdma_chan *, struct shdma_desc *); 100 99 struct shdma_desc *(*embedded_desc)(void *, int); 101 100 bool (*chan_irq)(struct shdma_chan *, int); 101 + size_t (*get_partial)(struct shdma_chan *, struct shdma_desc *); 102 102 }; 103 103 104 104 struct shdma_dev {