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

Merge remote-tracking branches 'regulator/fix/anatop', 'regulator/fix/gpio', 'regulator/fix/pbias', 'regulator/fix/tpx65218' and 'regulator/fix/vexpress' into regulator-linus

+60 -8
+6 -1
Documentation/devicetree/bindings/regulator/pbias-regulator.txt
··· 2 2 3 3 Required properties: 4 4 - compatible: 5 - - "ti,pbias-omap" for OMAP2, OMAP3, OMAP4, OMAP5, DRA7. 5 + - should be "ti,pbias-dra7" for DRA7 6 + - should be "ti,pbias-omap2" for OMAP2 7 + - should be "ti,pbias-omap3" for OMAP3 8 + - should be "ti,pbias-omap4" for OMAP4 9 + - should be "ti,pbias-omap5" for OMAP5 10 + - "ti,pbias-omap" is deprecated 6 11 - reg: pbias register offset from syscon base and size of pbias register. 7 12 - syscon : phandle of the system control module 8 13 - regulator-name : should be
+1
drivers/regulator/anatop-regulator.c
··· 318 318 { .compatible = "fsl,anatop-regulator", }, 319 319 { /* end */ } 320 320 }; 321 + MODULE_DEVICE_TABLE(of, of_anatop_regulator_match_tbl); 321 322 322 323 static struct platform_driver anatop_regulator_driver = { 323 324 .driver = {
+1
drivers/regulator/gpio-regulator.c
··· 394 394 { .compatible = "regulator-gpio", }, 395 395 {}, 396 396 }; 397 + MODULE_DEVICE_TABLE(of, regulator_gpio_of_match); 397 398 #endif 398 399 399 400 static struct platform_driver gpio_regulator_driver = {
+50 -6
drivers/regulator/pbias-regulator.c
··· 45 45 int voltage; 46 46 }; 47 47 48 + struct pbias_of_data { 49 + unsigned int offset; 50 + }; 51 + 48 52 static const unsigned int pbias_volt_table[] = { 49 53 1800000, 50 54 3000000 ··· 106 102 }; 107 103 #define PBIAS_NUM_REGS ARRAY_SIZE(pbias_matches) 108 104 105 + /* Offset from SCM general area (and syscon) base */ 106 + 107 + static const struct pbias_of_data pbias_of_data_omap2 = { 108 + .offset = 0x230, 109 + }; 110 + 111 + static const struct pbias_of_data pbias_of_data_omap3 = { 112 + .offset = 0x2b0, 113 + }; 114 + 115 + static const struct pbias_of_data pbias_of_data_omap4 = { 116 + .offset = 0x60, 117 + }; 118 + 119 + static const struct pbias_of_data pbias_of_data_omap5 = { 120 + .offset = 0x60, 121 + }; 122 + 123 + static const struct pbias_of_data pbias_of_data_dra7 = { 124 + .offset = 0xe00, 125 + }; 126 + 109 127 static const struct of_device_id pbias_of_match[] = { 110 128 { .compatible = "ti,pbias-omap", }, 129 + { .compatible = "ti,pbias-omap2", .data = &pbias_of_data_omap2, }, 130 + { .compatible = "ti,pbias-omap3", .data = &pbias_of_data_omap3, }, 131 + { .compatible = "ti,pbias-omap4", .data = &pbias_of_data_omap4, }, 132 + { .compatible = "ti,pbias-omap5", .data = &pbias_of_data_omap5, }, 133 + { .compatible = "ti,pbias-dra7", .data = &pbias_of_data_dra7, }, 111 134 {}, 112 135 }; 113 136 MODULE_DEVICE_TABLE(of, pbias_of_match); ··· 149 118 const struct pbias_reg_info *info; 150 119 int ret = 0; 151 120 int count, idx, data_idx = 0; 121 + const struct of_device_id *match; 122 + const struct pbias_of_data *data; 123 + unsigned int offset; 152 124 153 125 count = of_regulator_match(&pdev->dev, np, pbias_matches, 154 126 PBIAS_NUM_REGS); ··· 167 133 if (IS_ERR(syscon)) 168 134 return PTR_ERR(syscon); 169 135 136 + match = of_match_device(of_match_ptr(pbias_of_match), &pdev->dev); 137 + if (match && match->data) { 138 + data = match->data; 139 + offset = data->offset; 140 + } else { 141 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 142 + if (!res) 143 + return -EINVAL; 144 + 145 + offset = res->start; 146 + dev_WARN(&pdev->dev, 147 + "using legacy dt data for pbias offset\n"); 148 + } 149 + 170 150 cfg.regmap = syscon; 171 151 cfg.dev = &pdev->dev; 172 152 ··· 193 145 if (!info) 194 146 return -ENODEV; 195 147 196 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 197 - if (!res) 198 - return -EINVAL; 199 - 200 148 drvdata[data_idx].syscon = syscon; 201 149 drvdata[data_idx].info = info; 202 150 drvdata[data_idx].desc.name = info->name; ··· 202 158 drvdata[data_idx].desc.volt_table = pbias_volt_table; 203 159 drvdata[data_idx].desc.n_voltages = 2; 204 160 drvdata[data_idx].desc.enable_time = info->enable_time; 205 - drvdata[data_idx].desc.vsel_reg = res->start; 161 + drvdata[data_idx].desc.vsel_reg = offset; 206 162 drvdata[data_idx].desc.vsel_mask = info->vmode; 207 - drvdata[data_idx].desc.enable_reg = res->start; 163 + drvdata[data_idx].desc.enable_reg = offset; 208 164 drvdata[data_idx].desc.enable_mask = info->enable_mask; 209 165 drvdata[data_idx].desc.enable_val = info->enable; 210 166 drvdata[data_idx].desc.disable_val = info->disable_val;
+1 -1
drivers/regulator/tps65218-regulator.c
··· 73 73 }; 74 74 75 75 static struct tps_info tps65218_pmic_regs[] = { 76 - TPS65218_INFO(DCDC1, "DCDC1", 850000, 167500), 76 + TPS65218_INFO(DCDC1, "DCDC1", 850000, 1675000), 77 77 TPS65218_INFO(DCDC2, "DCDC2", 850000, 1675000), 78 78 TPS65218_INFO(DCDC3, "DCDC3", 900000, 3400000), 79 79 TPS65218_INFO(DCDC4, "DCDC4", 1175000, 3400000),
+1
drivers/regulator/vexpress.c
··· 103 103 { .compatible = "arm,vexpress-volt", }, 104 104 { } 105 105 }; 106 + MODULE_DEVICE_TABLE(of, vexpress_regulator_of_match); 106 107 107 108 static struct platform_driver vexpress_regulator_driver = { 108 109 .probe = vexpress_regulator_probe,