Skip to content

Commit ff14086

Browse files
committed
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes
From Tony Lindgren: Note that this also contains a set of fixes that are not regressions or oopses to properly deal with the smsc911x regulator issue. Basically the regulators must be per board file as the regulators can also come from drivers, such as twl4030. So it's best to dumb down gpmc-smsc911x.c to not even care about the regulators. * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: OMAP: fix section mismatches in usb-host.c ARM: OMAP2+: Fix omap2+ build error ARM: OMAP2+: smsc911x: Add fixed board regulators ARM: OMAP2+: smsc911x: Remove regulator support from gmpc-smsc911x ARM: OMAP2+: smsc911x: Remove unused rate calculation ARM: OMAP2+ smsc911x: Fix possible stale smsc911x flags ARM: OMAP2+: smsc911x: Remove odd gpmc_cfg/board_data redirection ARM: OMAP3+: fix oops triggered in omap_prcm_register_chain_handler(v1) ARM: OMAP2+: OPP: allow OPP enumeration to continue if device is not present arm: omap3: pm34xx.c: Replace printk() with appropriate pr_*() arm: omap3: pm34xx.c: Fix omap3_pm_init() error out paths ARM: OMAP4: Workaround the OCP synchronisation issue with 32K synctimer. ARM: OMAP4: prm: fix interrupt register offsets ARM: OMAP: hwmod: Use sysc_fields->srst_shift and get rid of hardcoded SYSC_TYPE2_SOFTRESET_MASK
2 parents 8078342 + 08956f1 commit ff14086

17 files changed

+122
-122
lines changed

arch/arm/include/asm/barrier.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define __ASM_BARRIER_H
33

44
#ifndef __ASSEMBLY__
5+
#include <asm/outercache.h>
56

67
#define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t");
78

@@ -39,7 +40,6 @@
3940
#ifdef CONFIG_ARCH_HAS_BARRIERS
4041
#include <mach/barriers.h>
4142
#elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || defined(CONFIG_SMP)
42-
#include <asm/outercache.h>
4343
#define mb() do { dsb(); outer_sync(); } while (0)
4444
#define rmb() dsb()
4545
#define wmb() mb()

arch/arm/mach-omap2/board-cm-t35.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include <linux/i2c/at24.h>
2828
#include <linux/i2c/twl.h>
29+
#include <linux/regulator/fixed.h>
2930
#include <linux/regulator/machine.h>
3031
#include <linux/mmc/host.h>
3132

@@ -81,8 +82,23 @@ static struct omap_smsc911x_platform_data sb_t35_smsc911x_cfg = {
8182
.flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
8283
};
8384

85+
static struct regulator_consumer_supply cm_t35_smsc911x_supplies[] = {
86+
REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
87+
REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
88+
};
89+
90+
static struct regulator_consumer_supply sb_t35_smsc911x_supplies[] = {
91+
REGULATOR_SUPPLY("vddvario", "smsc911x.1"),
92+
REGULATOR_SUPPLY("vdd33a", "smsc911x.1"),
93+
};
94+
8495
static void __init cm_t35_init_ethernet(void)
8596
{
97+
regulator_register_fixed(0, cm_t35_smsc911x_supplies,
98+
ARRAY_SIZE(cm_t35_smsc911x_supplies));
99+
regulator_register_fixed(1, sb_t35_smsc911x_supplies,
100+
ARRAY_SIZE(sb_t35_smsc911x_supplies));
101+
86102
gpmc_smsc911x_init(&cm_t35_smsc911x_cfg);
87103
gpmc_smsc911x_init(&sb_t35_smsc911x_cfg);
88104
}

arch/arm/mach-omap2/board-igep0020.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,8 +634,14 @@ static void __init igep_wlan_bt_init(void)
634634
static inline void __init igep_wlan_bt_init(void) { }
635635
#endif
636636

637+
static struct regulator_consumer_supply dummy_supplies[] = {
638+
REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
639+
REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
640+
};
641+
637642
static void __init igep_init(void)
638643
{
644+
regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
639645
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
640646

641647
/* Get IGEP2 hardware revision */

arch/arm/mach-omap2/board-ldp.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <linux/err.h>
2323
#include <linux/clk.h>
2424
#include <linux/spi/spi.h>
25+
#include <linux/regulator/fixed.h>
2526
#include <linux/regulator/machine.h>
2627
#include <linux/i2c/twl.h>
2728
#include <linux/io.h>
@@ -410,8 +411,14 @@ static struct mtd_partition ldp_nand_partitions[] = {
410411

411412
};
412413

414+
static struct regulator_consumer_supply dummy_supplies[] = {
415+
REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
416+
REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
417+
};
418+
413419
static void __init omap_ldp_init(void)
414420
{
421+
regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
415422
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
416423
ldp_init_smsc911x();
417424
omap_i2c_init();

arch/arm/mach-omap2/board-omap3evm.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,6 @@ static struct omap_smsc911x_platform_data smsc911x_cfg = {
114114

115115
static inline void __init omap3evm_init_smsc911x(void)
116116
{
117-
struct clk *l3ck;
118-
unsigned int rate;
119-
120-
l3ck = clk_get(NULL, "l3_ck");
121-
if (IS_ERR(l3ck))
122-
rate = 100000000;
123-
else
124-
rate = clk_get_rate(l3ck);
125-
126117
/* Configure ethernet controller reset gpio */
127118
if (cpu_is_omap3430()) {
128119
if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1)
@@ -632,9 +623,15 @@ static void __init omap3_evm_wl12xx_init(void)
632623
#endif
633624
}
634625

626+
static struct regulator_consumer_supply dummy_supplies[] = {
627+
REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
628+
REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
629+
};
630+
635631
static void __init omap3_evm_init(void)
636632
{
637633
omap3_evm_get_revision();
634+
regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
638635

639636
if (cpu_is_omap3630())
640637
omap3_mux_init(omap36x_board_mux, OMAP_PACKAGE_CBB);

arch/arm/mach-omap2/board-omap3logic.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <linux/io.h>
2424
#include <linux/gpio.h>
2525

26+
#include <linux/regulator/fixed.h>
2627
#include <linux/regulator/machine.h>
2728

2829
#include <linux/i2c/twl.h>
@@ -188,8 +189,14 @@ static struct omap_board_mux board_mux[] __initdata = {
188189
};
189190
#endif
190191

192+
static struct regulator_consumer_supply dummy_supplies[] = {
193+
REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
194+
REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
195+
};
196+
191197
static void __init omap3logic_init(void)
192198
{
199+
regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
193200
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
194201
omap3torpedo_fix_pbias_voltage();
195202
omap3logic_i2c_init();

arch/arm/mach-omap2/board-omap3stalker.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <linux/input.h>
2525
#include <linux/gpio_keys.h>
2626

27+
#include <linux/regulator/fixed.h>
2728
#include <linux/regulator/machine.h>
2829
#include <linux/i2c/twl.h>
2930
#include <linux/mmc/host.h>
@@ -72,15 +73,6 @@ static struct omap_smsc911x_platform_data smsc911x_cfg = {
7273

7374
static inline void __init omap3stalker_init_eth(void)
7475
{
75-
struct clk *l3ck;
76-
unsigned int rate;
77-
78-
l3ck = clk_get(NULL, "l3_ck");
79-
if (IS_ERR(l3ck))
80-
rate = 100000000;
81-
else
82-
rate = clk_get_rate(l3ck);
83-
8476
omap_mux_init_gpio(19, OMAP_PIN_INPUT_PULLUP);
8577
gpmc_smsc911x_init(&smsc911x_cfg);
8678
}
@@ -419,8 +411,14 @@ static struct omap_board_mux board_mux[] __initdata = {
419411
};
420412
#endif
421413

414+
static struct regulator_consumer_supply dummy_supplies[] = {
415+
REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
416+
REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
417+
};
418+
422419
static void __init omap3_stalker_init(void)
423420
{
421+
regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
424422
omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);
425423
omap_board_config = omap3_stalker_config;
426424
omap_board_config_size = ARRAY_SIZE(omap3_stalker_config);

arch/arm/mach-omap2/board-overo.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,10 +498,18 @@ static struct gpio overo_bt_gpios[] __initdata = {
498498
{ OVERO_GPIO_BT_NRESET, GPIOF_OUT_INIT_HIGH, "lcd bl enable" },
499499
};
500500

501+
static struct regulator_consumer_supply dummy_supplies[] = {
502+
REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
503+
REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
504+
REGULATOR_SUPPLY("vddvario", "smsc911x.1"),
505+
REGULATOR_SUPPLY("vdd33a", "smsc911x.1"),
506+
};
507+
501508
static void __init overo_init(void)
502509
{
503510
int ret;
504511

512+
regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
505513
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
506514
omap_hsmmc_init(mmc);
507515
overo_i2c_init();

arch/arm/mach-omap2/board-zoom-debugboard.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
#include <linux/smsc911x.h>
1515
#include <linux/interrupt.h>
1616

17+
#include <linux/regulator/fixed.h>
18+
#include <linux/regulator/machine.h>
19+
1720
#include <plat/gpmc.h>
1821
#include <plat/gpmc-smsc911x.h>
1922

@@ -117,11 +120,17 @@ static struct platform_device *zoom_devices[] __initdata = {
117120
&zoom_debugboard_serial_device,
118121
};
119122

123+
static struct regulator_consumer_supply dummy_supplies[] = {
124+
REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
125+
REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
126+
};
127+
120128
int __init zoom_debugboard_init(void)
121129
{
122130
if (!omap_zoom_debugboard_detect())
123131
return 0;
124132

133+
regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
125134
zoom_init_smsc911x();
126135
zoom_init_quaduart();
127136
return platform_add_devices(zoom_devices, ARRAY_SIZE(zoom_devices));

arch/arm/mach-omap2/gpmc-smsc911x.c

Lines changed: 2 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,11 @@
1919
#include <linux/interrupt.h>
2020
#include <linux/io.h>
2121
#include <linux/smsc911x.h>
22-
#include <linux/regulator/fixed.h>
23-
#include <linux/regulator/machine.h>
2422

2523
#include <plat/board.h>
2624
#include <plat/gpmc.h>
2725
#include <plat/gpmc-smsc911x.h>
2826

29-
static struct omap_smsc911x_platform_data *gpmc_cfg;
30-
3127
static struct resource gpmc_smsc911x_resources[] = {
3228
[0] = {
3329
.flags = IORESOURCE_MEM,
@@ -41,75 +37,19 @@ static struct smsc911x_platform_config gpmc_smsc911x_config = {
4137
.phy_interface = PHY_INTERFACE_MODE_MII,
4238
.irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
4339
.irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
44-
.flags = SMSC911X_USE_16BIT,
45-
};
46-
47-
static struct regulator_consumer_supply gpmc_smsc911x_supply[] = {
48-
REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
49-
REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
50-
};
51-
52-
/* Generic regulator definition to satisfy smsc911x */
53-
static struct regulator_init_data gpmc_smsc911x_reg_init_data = {
54-
.constraints = {
55-
.min_uV = 3300000,
56-
.max_uV = 3300000,
57-
.valid_modes_mask = REGULATOR_MODE_NORMAL
58-
| REGULATOR_MODE_STANDBY,
59-
.valid_ops_mask = REGULATOR_CHANGE_MODE
60-
| REGULATOR_CHANGE_STATUS,
61-
},
62-
.num_consumer_supplies = ARRAY_SIZE(gpmc_smsc911x_supply),
63-
.consumer_supplies = gpmc_smsc911x_supply,
64-
};
65-
66-
static struct fixed_voltage_config gpmc_smsc911x_fixed_reg_data = {
67-
.supply_name = "gpmc_smsc911x",
68-
.microvolts = 3300000,
69-
.gpio = -EINVAL,
70-
.startup_delay = 0,
71-
.enable_high = 0,
72-
.enabled_at_boot = 1,
73-
.init_data = &gpmc_smsc911x_reg_init_data,
74-
};
75-
76-
/*
77-
* Platform device id of 42 is a temporary fix to avoid conflicts
78-
* with other reg-fixed-voltage devices. The real fix should
79-
* involve the driver core providing a way of dynamically
80-
* assigning a unique id on registration for platform devices
81-
* in the same name space.
82-
*/
83-
static struct platform_device gpmc_smsc911x_regulator = {
84-
.name = "reg-fixed-voltage",
85-
.id = 42,
86-
.dev = {
87-
.platform_data = &gpmc_smsc911x_fixed_reg_data,
88-
},
8940
};
9041

9142
/*
9243
* Initialize smsc911x device connected to the GPMC. Note that we
9344
* assume that pin multiplexing is done in the board-*.c file,
9445
* or in the bootloader.
9546
*/
96-
void __init gpmc_smsc911x_init(struct omap_smsc911x_platform_data *board_data)
47+
void __init gpmc_smsc911x_init(struct omap_smsc911x_platform_data *gpmc_cfg)
9748
{
9849
struct platform_device *pdev;
9950
unsigned long cs_mem_base;
10051
int ret;
10152

102-
gpmc_cfg = board_data;
103-
104-
if (!gpmc_cfg->id) {
105-
ret = platform_device_register(&gpmc_smsc911x_regulator);
106-
if (ret < 0) {
107-
pr_err("Unable to register smsc911x regulators: %d\n",
108-
ret);
109-
return;
110-
}
111-
}
112-
11353
if (gpmc_cs_request(gpmc_cfg->cs, SZ_16M, &cs_mem_base) < 0) {
11454
pr_err("Failed to request GPMC mem region\n");
11555
return;
@@ -139,8 +79,7 @@ void __init gpmc_smsc911x_init(struct omap_smsc911x_platform_data *board_data)
13979
gpio_set_value(gpmc_cfg->gpio_reset, 1);
14080
}
14181

142-
if (gpmc_cfg->flags)
143-
gpmc_smsc911x_config.flags = gpmc_cfg->flags;
82+
gpmc_smsc911x_config.flags = gpmc_cfg->flags ? : SMSC911X_USE_16BIT;
14483

14584
pdev = platform_device_register_resndata(NULL, "smsc911x", gpmc_cfg->id,
14685
gpmc_smsc911x_resources, ARRAY_SIZE(gpmc_smsc911x_resources),

arch/arm/mach-omap2/omap_hwmod.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,7 @@ static int _read_hardreset(struct omap_hwmod *oh, const char *name)
13951395
*/
13961396
static int _ocp_softreset(struct omap_hwmod *oh)
13971397
{
1398-
u32 v;
1398+
u32 v, softrst_mask;
13991399
int c = 0;
14001400
int ret = 0;
14011401

@@ -1427,11 +1427,13 @@ static int _ocp_softreset(struct omap_hwmod *oh)
14271427
oh->class->sysc->syss_offs)
14281428
& SYSS_RESETDONE_MASK),
14291429
MAX_MODULE_SOFTRESET_WAIT, c);
1430-
else if (oh->class->sysc->sysc_flags & SYSC_HAS_RESET_STATUS)
1430+
else if (oh->class->sysc->sysc_flags & SYSC_HAS_RESET_STATUS) {
1431+
softrst_mask = (0x1 << oh->class->sysc->sysc_fields->srst_shift);
14311432
omap_test_timeout(!(omap_hwmod_read(oh,
14321433
oh->class->sysc->sysc_offs)
1433-
& SYSC_TYPE2_SOFTRESET_MASK),
1434+
& softrst_mask),
14341435
MAX_MODULE_SOFTRESET_WAIT, c);
1436+
}
14351437

14361438
if (c == MAX_MODULE_SOFTRESET_WAIT)
14371439
pr_warning("omap_hwmod: %s: softreset failed (waited %d usec)\n",

arch/arm/mach-omap2/opp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ int __init omap_init_opp_table(struct omap_opp_def *opp_def,
6464
}
6565
oh = omap_hwmod_lookup(opp_def->hwmod_name);
6666
if (!oh || !oh->od) {
67-
pr_warn("%s: no hwmod or odev for %s, [%d] "
67+
pr_debug("%s: no hwmod or odev for %s, [%d] "
6868
"cannot add OPPs.\n", __func__,
6969
opp_def->hwmod_name, i);
70-
return -EINVAL;
70+
continue;
7171
}
7272
dev = &oh->od->pdev->dev;
7373

0 commit comments

Comments
 (0)