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

reset: Add reset_control_bulk API

Follow the clock and regulator subsystems' lead and add a bulk API
for reset controls.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210314154459.15375-5-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Philipp Zabel and committed by
Mark Brown
48d71395 0bbcecaa

+530
+215
drivers/reset/core.c
··· 359 359 EXPORT_SYMBOL_GPL(reset_control_reset); 360 360 361 361 /** 362 + * reset_control_bulk_reset - reset the controlled devices in order 363 + * @num_rstcs: number of entries in rstcs array 364 + * @rstcs: array of struct reset_control_bulk_data with reset controls set 365 + * 366 + * Issue a reset on all provided reset controls, in order. 367 + * 368 + * See also: reset_control_reset() 369 + */ 370 + int reset_control_bulk_reset(int num_rstcs, 371 + struct reset_control_bulk_data *rstcs) 372 + { 373 + int ret, i; 374 + 375 + for (i = 0; i < num_rstcs; i++) { 376 + ret = reset_control_reset(rstcs[i].rstc); 377 + if (ret) 378 + return ret; 379 + } 380 + 381 + return 0; 382 + } 383 + EXPORT_SYMBOL_GPL(reset_control_bulk_reset); 384 + 385 + /** 362 386 * reset_control_rearm - allow shared reset line to be re-triggered" 363 387 * @rstc: reset controller 364 388 * ··· 486 462 EXPORT_SYMBOL_GPL(reset_control_assert); 487 463 488 464 /** 465 + * reset_control_bulk_assert - asserts the reset lines in order 466 + * @num_rstcs: number of entries in rstcs array 467 + * @rstcs: array of struct reset_control_bulk_data with reset controls set 468 + * 469 + * Assert the reset lines for all provided reset controls, in order. 470 + * If an assertion fails, already asserted resets are deasserted again. 471 + * 472 + * See also: reset_control_assert() 473 + */ 474 + int reset_control_bulk_assert(int num_rstcs, 475 + struct reset_control_bulk_data *rstcs) 476 + { 477 + int ret, i; 478 + 479 + for (i = 0; i < num_rstcs; i++) { 480 + ret = reset_control_assert(rstcs[i].rstc); 481 + if (ret) 482 + goto err; 483 + } 484 + 485 + return 0; 486 + 487 + err: 488 + while (i--) 489 + reset_control_deassert(rstcs[i].rstc); 490 + return ret; 491 + } 492 + EXPORT_SYMBOL_GPL(reset_control_bulk_assert); 493 + 494 + /** 489 495 * reset_control_deassert - deasserts the reset line 490 496 * @rstc: reset controller 491 497 * ··· 564 510 return rstc->rcdev->ops->deassert(rstc->rcdev, rstc->id); 565 511 } 566 512 EXPORT_SYMBOL_GPL(reset_control_deassert); 513 + 514 + /** 515 + * reset_control_bulk_deassert - deasserts the reset lines in reverse order 516 + * @num_rstcs: number of entries in rstcs array 517 + * @rstcs: array of struct reset_control_bulk_data with reset controls set 518 + * 519 + * Deassert the reset lines for all provided reset controls, in reverse order. 520 + * If a deassertion fails, already deasserted resets are asserted again. 521 + * 522 + * See also: reset_control_deassert() 523 + */ 524 + int reset_control_bulk_deassert(int num_rstcs, 525 + struct reset_control_bulk_data *rstcs) 526 + { 527 + int ret, i; 528 + 529 + for (i = num_rstcs - 1; i >= 0; i--) { 530 + ret = reset_control_deassert(rstcs[i].rstc); 531 + if (ret) 532 + goto err; 533 + } 534 + 535 + return 0; 536 + 537 + err: 538 + while (i < num_rstcs) 539 + reset_control_assert(rstcs[i++].rstc); 540 + return ret; 541 + } 542 + EXPORT_SYMBOL_GPL(reset_control_bulk_deassert); 567 543 568 544 /** 569 545 * reset_control_status - returns a negative errno if not supported, a ··· 673 589 EXPORT_SYMBOL_GPL(reset_control_acquire); 674 590 675 591 /** 592 + * reset_control_bulk_acquire - acquires reset controls for exclusive use 593 + * @num_rstcs: number of entries in rstcs array 594 + * @rstcs: array of struct reset_control_bulk_data with reset controls set 595 + * 596 + * This is used to explicitly acquire reset controls requested with 597 + * reset_control_bulk_get_exclusive_release() for temporary exclusive use. 598 + * 599 + * See also: reset_control_acquire(), reset_control_bulk_release() 600 + */ 601 + int reset_control_bulk_acquire(int num_rstcs, 602 + struct reset_control_bulk_data *rstcs) 603 + { 604 + int ret, i; 605 + 606 + for (i = 0; i < num_rstcs; i++) { 607 + ret = reset_control_acquire(rstcs[i].rstc); 608 + if (ret) 609 + goto err; 610 + } 611 + 612 + return 0; 613 + 614 + err: 615 + while (i--) 616 + reset_control_release(rstcs[i].rstc); 617 + return ret; 618 + } 619 + EXPORT_SYMBOL_GPL(reset_control_bulk_acquire); 620 + 621 + /** 676 622 * reset_control_release() - releases exclusive access to a reset control 677 623 * @rstc: reset control 678 624 * ··· 723 609 rstc->acquired = false; 724 610 } 725 611 EXPORT_SYMBOL_GPL(reset_control_release); 612 + 613 + /** 614 + * reset_control_bulk_release() - releases exclusive access to reset controls 615 + * @num_rstcs: number of entries in rstcs array 616 + * @rstcs: array of struct reset_control_bulk_data with reset controls set 617 + * 618 + * Releases exclusive access right to reset controls previously obtained by a 619 + * call to reset_control_bulk_acquire(). 620 + * 621 + * See also: reset_control_release(), reset_control_bulk_acquire() 622 + */ 623 + void reset_control_bulk_release(int num_rstcs, 624 + struct reset_control_bulk_data *rstcs) 625 + { 626 + int i; 627 + 628 + for (i = 0; i < num_rstcs; i++) 629 + reset_control_release(rstcs[i].rstc); 630 + } 631 + EXPORT_SYMBOL_GPL(reset_control_bulk_release); 726 632 727 633 static struct reset_control *__reset_control_get_internal( 728 634 struct reset_controller_dev *rcdev, ··· 948 814 } 949 815 EXPORT_SYMBOL_GPL(__reset_control_get); 950 816 817 + int __reset_control_bulk_get(struct device *dev, int num_rstcs, 818 + struct reset_control_bulk_data *rstcs, 819 + bool shared, bool optional, bool acquired) 820 + { 821 + int ret, i; 822 + 823 + for (i = 0; i < num_rstcs; i++) { 824 + rstcs[i].rstc = __reset_control_get(dev, rstcs[i].id, 0, 825 + shared, optional, acquired); 826 + if (IS_ERR(rstcs[i].rstc)) { 827 + ret = PTR_ERR(rstcs[i].rstc); 828 + goto err; 829 + } 830 + } 831 + 832 + return 0; 833 + 834 + err: 835 + mutex_lock(&reset_list_mutex); 836 + while (i--) 837 + __reset_control_put_internal(rstcs[i].rstc); 838 + mutex_unlock(&reset_list_mutex); 839 + return ret; 840 + } 841 + EXPORT_SYMBOL_GPL(__reset_control_bulk_get); 842 + 951 843 static void reset_control_array_put(struct reset_control_array *resets) 952 844 { 953 845 int i; ··· 1005 845 } 1006 846 EXPORT_SYMBOL_GPL(reset_control_put); 1007 847 848 + /** 849 + * reset_control_bulk_put - free the reset controllers 850 + * @num_rstcs: number of entries in rstcs array 851 + * @rstcs: array of struct reset_control_bulk_data with reset controls set 852 + */ 853 + void reset_control_bulk_put(int num_rstcs, struct reset_control_bulk_data *rstcs) 854 + { 855 + mutex_lock(&reset_list_mutex); 856 + while (num_rstcs--) { 857 + if (IS_ERR_OR_NULL(rstcs[num_rstcs].rstc)) 858 + continue; 859 + __reset_control_put_internal(rstcs[num_rstcs].rstc); 860 + } 861 + mutex_unlock(&reset_list_mutex); 862 + } 863 + EXPORT_SYMBOL_GPL(reset_control_bulk_put); 864 + 1008 865 static void devm_reset_control_release(struct device *dev, void *res) 1009 866 { 1010 867 reset_control_put(*(struct reset_control **)res); ··· 1050 873 return rstc; 1051 874 } 1052 875 EXPORT_SYMBOL_GPL(__devm_reset_control_get); 876 + 877 + struct reset_control_bulk_devres { 878 + int num_rstcs; 879 + struct reset_control_bulk_data *rstcs; 880 + }; 881 + 882 + static void devm_reset_control_bulk_release(struct device *dev, void *res) 883 + { 884 + struct reset_control_bulk_devres *devres = res; 885 + 886 + reset_control_bulk_put(devres->num_rstcs, devres->rstcs); 887 + } 888 + 889 + int __devm_reset_control_bulk_get(struct device *dev, int num_rstcs, 890 + struct reset_control_bulk_data *rstcs, 891 + bool shared, bool optional, bool acquired) 892 + { 893 + struct reset_control_bulk_devres *ptr; 894 + int ret; 895 + 896 + ptr = devres_alloc(devm_reset_control_bulk_release, sizeof(*ptr), 897 + GFP_KERNEL); 898 + if (!ptr) 899 + return -ENOMEM; 900 + 901 + ret = __reset_control_bulk_get(dev, num_rstcs, rstcs, shared, optional, acquired); 902 + if (ret < 0) { 903 + devres_free(ptr); 904 + return ret; 905 + } 906 + 907 + ptr->num_rstcs = num_rstcs; 908 + ptr->rstcs = rstcs; 909 + devres_add(dev, ptr); 910 + 911 + return 0; 912 + } 913 + EXPORT_SYMBOL_GPL(__devm_reset_control_bulk_get); 1053 914 1054 915 /** 1055 916 * __device_reset - find reset controller associated with the device
+315
include/linux/reset.h
··· 10 10 struct device_node; 11 11 struct reset_control; 12 12 13 + /** 14 + * struct reset_control_bulk_data - Data used for bulk reset control operations. 15 + * 16 + * @id: reset control consumer ID 17 + * @rstc: struct reset_control * to store the associated reset control 18 + * 19 + * The reset APIs provide a series of reset_control_bulk_*() API calls as 20 + * a convenience to consumers which require multiple reset controls. 21 + * This structure is used to manage data for these calls. 22 + */ 23 + struct reset_control_bulk_data { 24 + const char *id; 25 + struct reset_control *rstc; 26 + }; 27 + 13 28 #ifdef CONFIG_RESET_CONTROLLER 14 29 15 30 int reset_control_reset(struct reset_control *rstc); ··· 35 20 int reset_control_acquire(struct reset_control *rstc); 36 21 void reset_control_release(struct reset_control *rstc); 37 22 23 + int reset_control_bulk_reset(int num_rstcs, struct reset_control_bulk_data *rstcs); 24 + int reset_control_bulk_assert(int num_rstcs, struct reset_control_bulk_data *rstcs); 25 + int reset_control_bulk_deassert(int num_rstcs, struct reset_control_bulk_data *rstcs); 26 + int reset_control_bulk_acquire(int num_rstcs, struct reset_control_bulk_data *rstcs); 27 + void reset_control_bulk_release(int num_rstcs, struct reset_control_bulk_data *rstcs); 28 + 38 29 struct reset_control *__of_reset_control_get(struct device_node *node, 39 30 const char *id, int index, bool shared, 40 31 bool optional, bool acquired); ··· 48 27 int index, bool shared, 49 28 bool optional, bool acquired); 50 29 void reset_control_put(struct reset_control *rstc); 30 + int __reset_control_bulk_get(struct device *dev, int num_rstcs, 31 + struct reset_control_bulk_data *rstcs, 32 + bool shared, bool optional, bool acquired); 33 + void reset_control_bulk_put(int num_rstcs, struct reset_control_bulk_data *rstcs); 34 + 51 35 int __device_reset(struct device *dev, bool optional); 52 36 struct reset_control *__devm_reset_control_get(struct device *dev, 53 37 const char *id, int index, bool shared, 54 38 bool optional, bool acquired); 39 + int __devm_reset_control_bulk_get(struct device *dev, int num_rstcs, 40 + struct reset_control_bulk_data *rstcs, 41 + bool shared, bool optional, bool acquired); 55 42 56 43 struct reset_control *devm_reset_control_array_get(struct device *dev, 57 44 bool shared, bool optional); ··· 125 96 return optional ? NULL : ERR_PTR(-ENOTSUPP); 126 97 } 127 98 99 + static inline int 100 + reset_control_bulk_reset(int num_rstcs, struct reset_control_bulk_data *rstcs) 101 + { 102 + return 0; 103 + } 104 + 105 + static inline int 106 + reset_control_bulk_assert(int num_rstcs, struct reset_control_bulk_data *rstcs) 107 + { 108 + return 0; 109 + } 110 + 111 + static inline int 112 + reset_control_bulk_deassert(int num_rstcs, struct reset_control_bulk_data *rstcs) 113 + { 114 + return 0; 115 + } 116 + 117 + static inline int 118 + reset_control_bulk_acquire(int num_rstcs, struct reset_control_bulk_data *rstcs) 119 + { 120 + return 0; 121 + } 122 + 123 + static inline void 124 + reset_control_bulk_release(int num_rstcs, struct reset_control_bulk_data *rstcs) 125 + { 126 + } 127 + 128 + static inline int 129 + __reset_control_bulk_get(struct device *dev, int num_rstcs, 130 + struct reset_control_bulk_data *rstcs, 131 + bool shared, bool optional, bool acquired) 132 + { 133 + return optional ? 0 : -EOPNOTSUPP; 134 + } 135 + 136 + static inline void 137 + reset_control_bulk_put(int num_rstcs, struct reset_control_bulk_data *rstcs) 138 + { 139 + } 140 + 128 141 static inline struct reset_control *__devm_reset_control_get( 129 142 struct device *dev, const char *id, 130 143 int index, bool shared, bool optional, 131 144 bool acquired) 132 145 { 133 146 return optional ? NULL : ERR_PTR(-ENOTSUPP); 147 + } 148 + 149 + static inline int 150 + __devm_reset_control_bulk_get(struct device *dev, int num_rstcs, 151 + struct reset_control_bulk_data *rstcs, 152 + bool shared, bool optional, bool acquired) 153 + { 154 + return optional ? 0 : -EOPNOTSUPP; 134 155 } 135 156 136 157 static inline struct reset_control * ··· 235 156 } 236 157 237 158 /** 159 + * reset_control_bulk_get_exclusive - Lookup and obtain exclusive references to 160 + * multiple reset controllers. 161 + * @dev: device to be reset by the controller 162 + * @num_rstcs: number of entries in rstcs array 163 + * @rstcs: array of struct reset_control_bulk_data with reset line names set 164 + * 165 + * Fills the rstcs array with pointers to exclusive reset controls and 166 + * returns 0, or an IS_ERR() condition containing errno. 167 + */ 168 + static inline int __must_check 169 + reset_control_bulk_get_exclusive(struct device *dev, int num_rstcs, 170 + struct reset_control_bulk_data *rstcs) 171 + { 172 + return __reset_control_bulk_get(dev, num_rstcs, rstcs, false, false, true); 173 + } 174 + 175 + /** 238 176 * reset_control_get_exclusive_released - Lookup and obtain a temoprarily 239 177 * exclusive reference to a reset 240 178 * controller. ··· 270 174 const char *id) 271 175 { 272 176 return __reset_control_get(dev, id, 0, false, false, false); 177 + } 178 + 179 + /** 180 + * reset_control_bulk_get_exclusive_released - Lookup and obtain temporarily 181 + * exclusive references to multiple reset 182 + * controllers. 183 + * @dev: device to be reset by the controller 184 + * @num_rstcs: number of entries in rstcs array 185 + * @rstcs: array of struct reset_control_bulk_data with reset line names set 186 + * 187 + * Fills the rstcs array with pointers to exclusive reset controls and 188 + * returns 0, or an IS_ERR() condition containing errno. 189 + * reset-controls returned by this function must be acquired via 190 + * reset_control_bulk_acquire() before they can be used and should be released 191 + * via reset_control_bulk_release() afterwards. 192 + */ 193 + static inline int __must_check 194 + reset_control_bulk_get_exclusive_released(struct device *dev, int num_rstcs, 195 + struct reset_control_bulk_data *rstcs) 196 + { 197 + return __reset_control_bulk_get(dev, num_rstcs, rstcs, false, false, false); 198 + } 199 + 200 + /** 201 + * reset_control_bulk_get_optional_exclusive_released - Lookup and obtain optional 202 + * temporarily exclusive references to multiple 203 + * reset controllers. 204 + * @dev: device to be reset by the controller 205 + * @num_rstcs: number of entries in rstcs array 206 + * @rstcs: array of struct reset_control_bulk_data with reset line names set 207 + * 208 + * Optional variant of reset_control_bulk_get_exclusive_released(). If the 209 + * requested reset is not specified in the device tree, this function returns 0 210 + * instead of an error and missing rtsc is set to NULL. 211 + * 212 + * See reset_control_bulk_get_exclusive_released() for more information. 213 + */ 214 + static inline int __must_check 215 + reset_control_bulk_get_optional_exclusive_released(struct device *dev, int num_rstcs, 216 + struct reset_control_bulk_data *rstcs) 217 + { 218 + return __reset_control_bulk_get(dev, num_rstcs, rstcs, false, true, false); 273 219 } 274 220 275 221 /** ··· 343 205 } 344 206 345 207 /** 208 + * reset_control_bulk_get_shared - Lookup and obtain shared references to 209 + * multiple reset controllers. 210 + * @dev: device to be reset by the controller 211 + * @num_rstcs: number of entries in rstcs array 212 + * @rstcs: array of struct reset_control_bulk_data with reset line names set 213 + * 214 + * Fills the rstcs array with pointers to shared reset controls and 215 + * returns 0, or an IS_ERR() condition containing errno. 216 + */ 217 + static inline int __must_check 218 + reset_control_bulk_get_shared(struct device *dev, int num_rstcs, 219 + struct reset_control_bulk_data *rstcs) 220 + { 221 + return __reset_control_bulk_get(dev, num_rstcs, rstcs, true, false, false); 222 + } 223 + 224 + /** 346 225 * reset_control_get_optional_exclusive - optional reset_control_get_exclusive() 347 226 * @dev: device to be reset by the controller 348 227 * @id: reset line name ··· 377 222 } 378 223 379 224 /** 225 + * reset_control_bulk_get_optional_exclusive - optional 226 + * reset_control_bulk_get_exclusive() 227 + * @dev: device to be reset by the controller 228 + * @num_rstcs: number of entries in rstcs array 229 + * @rstcs: array of struct reset_control_bulk_data with reset line names set 230 + * 231 + * Optional variant of reset_control_bulk_get_exclusive(). If any of the 232 + * requested resets are not specified in the device tree, this function sets 233 + * them to NULL instead of returning an error. 234 + * 235 + * See reset_control_bulk_get_exclusive() for more information. 236 + */ 237 + static inline int __must_check 238 + reset_control_bulk_get_optional_exclusive(struct device *dev, int num_rstcs, 239 + struct reset_control_bulk_data *rstcs) 240 + { 241 + return __reset_control_bulk_get(dev, num_rstcs, rstcs, false, true, true); 242 + } 243 + 244 + /** 380 245 * reset_control_get_optional_shared - optional reset_control_get_shared() 381 246 * @dev: device to be reset by the controller 382 247 * @id: reset line name ··· 411 236 struct device *dev, const char *id) 412 237 { 413 238 return __reset_control_get(dev, id, 0, true, true, false); 239 + } 240 + 241 + /** 242 + * reset_control_bulk_get_optional_shared - optional 243 + * reset_control_bulk_get_shared() 244 + * @dev: device to be reset by the controller 245 + * @num_rstcs: number of entries in rstcs array 246 + * @rstcs: array of struct reset_control_bulk_data with reset line names set 247 + * 248 + * Optional variant of reset_control_bulk_get_shared(). If the requested resets 249 + * are not specified in the device tree, this function sets them to NULL 250 + * instead of returning an error. 251 + * 252 + * See reset_control_bulk_get_shared() for more information. 253 + */ 254 + static inline int __must_check 255 + reset_control_bulk_get_optional_shared(struct device *dev, int num_rstcs, 256 + struct reset_control_bulk_data *rstcs) 257 + { 258 + return __reset_control_bulk_get(dev, num_rstcs, rstcs, true, true, false); 414 259 } 415 260 416 261 /** ··· 539 344 } 540 345 541 346 /** 347 + * devm_reset_control_bulk_get_exclusive - resource managed 348 + * reset_control_bulk_get_exclusive() 349 + * @dev: device to be reset by the controller 350 + * @num_rstcs: number of entries in rstcs array 351 + * @rstcs: array of struct reset_control_bulk_data with reset line names set 352 + * 353 + * Managed reset_control_bulk_get_exclusive(). For reset controllers returned 354 + * from this function, reset_control_put() is called automatically on driver 355 + * detach. 356 + * 357 + * See reset_control_bulk_get_exclusive() for more information. 358 + */ 359 + static inline int __must_check 360 + devm_reset_control_bulk_get_exclusive(struct device *dev, int num_rstcs, 361 + struct reset_control_bulk_data *rstcs) 362 + { 363 + return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, false, false, true); 364 + } 365 + 366 + /** 542 367 * devm_reset_control_get_exclusive_released - resource managed 543 368 * reset_control_get_exclusive_released() 544 369 * @dev: device to be reset by the controller ··· 575 360 const char *id) 576 361 { 577 362 return __devm_reset_control_get(dev, id, 0, false, false, false); 363 + } 364 + 365 + /** 366 + * devm_reset_control_bulk_get_exclusive_released - resource managed 367 + * reset_control_bulk_get_exclusive_released() 368 + * @dev: device to be reset by the controller 369 + * @num_rstcs: number of entries in rstcs array 370 + * @rstcs: array of struct reset_control_bulk_data with reset line names set 371 + * 372 + * Managed reset_control_bulk_get_exclusive_released(). For reset controllers 373 + * returned from this function, reset_control_put() is called automatically on 374 + * driver detach. 375 + * 376 + * See reset_control_bulk_get_exclusive_released() for more information. 377 + */ 378 + static inline int __must_check 379 + devm_reset_control_bulk_get_exclusive_released(struct device *dev, int num_rstcs, 380 + struct reset_control_bulk_data *rstcs) 381 + { 382 + return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, false, false, false); 578 383 } 579 384 580 385 /** ··· 617 382 } 618 383 619 384 /** 385 + * devm_reset_control_bulk_get_optional_exclusive_released - resource managed 386 + * reset_control_bulk_optional_get_exclusive_released() 387 + * @dev: device to be reset by the controller 388 + * @num_rstcs: number of entries in rstcs array 389 + * @rstcs: array of struct reset_control_bulk_data with reset line names set 390 + * 391 + * Managed reset_control_bulk_optional_get_exclusive_released(). For reset 392 + * controllers returned from this function, reset_control_put() is called 393 + * automatically on driver detach. 394 + * 395 + * See reset_control_bulk_optional_get_exclusive_released() for more information. 396 + */ 397 + static inline int __must_check 398 + devm_reset_control_bulk_get_optional_exclusive_released(struct device *dev, int num_rstcs, 399 + struct reset_control_bulk_data *rstcs) 400 + { 401 + return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, false, true, false); 402 + } 403 + 404 + /** 620 405 * devm_reset_control_get_shared - resource managed reset_control_get_shared() 621 406 * @dev: device to be reset by the controller 622 407 * @id: reset line name ··· 649 394 struct device *dev, const char *id) 650 395 { 651 396 return __devm_reset_control_get(dev, id, 0, true, false, false); 397 + } 398 + 399 + /** 400 + * devm_reset_control_bulk_get_shared - resource managed 401 + * reset_control_bulk_get_shared() 402 + * @dev: device to be reset by the controller 403 + * @num_rstcs: number of entries in rstcs array 404 + * @rstcs: array of struct reset_control_bulk_data with reset line names set 405 + * 406 + * Managed reset_control_bulk_get_shared(). For reset controllers returned 407 + * from this function, reset_control_put() is called automatically on driver 408 + * detach. 409 + * 410 + * See reset_control_bulk_get_shared() for more information. 411 + */ 412 + static inline int __must_check 413 + devm_reset_control_bulk_get_shared(struct device *dev, int num_rstcs, 414 + struct reset_control_bulk_data *rstcs) 415 + { 416 + return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, true, false, false); 652 417 } 653 418 654 419 /** ··· 690 415 } 691 416 692 417 /** 418 + * devm_reset_control_bulk_get_optional_exclusive - resource managed 419 + * reset_control_bulk_get_optional_exclusive() 420 + * @dev: device to be reset by the controller 421 + * @num_rstcs: number of entries in rstcs array 422 + * @rstcs: array of struct reset_control_bulk_data with reset line names set 423 + * 424 + * Managed reset_control_bulk_get_optional_exclusive(). For reset controllers 425 + * returned from this function, reset_control_put() is called automatically on 426 + * driver detach. 427 + * 428 + * See reset_control_bulk_get_optional_exclusive() for more information. 429 + */ 430 + static inline int __must_check 431 + devm_reset_control_bulk_get_optional_exclusive(struct device *dev, int num_rstcs, 432 + struct reset_control_bulk_data *rstcs) 433 + { 434 + return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, true, false, true); 435 + } 436 + 437 + /** 693 438 * devm_reset_control_get_optional_shared - resource managed 694 439 * reset_control_get_optional_shared() 695 440 * @dev: device to be reset by the controller ··· 725 430 struct device *dev, const char *id) 726 431 { 727 432 return __devm_reset_control_get(dev, id, 0, true, true, false); 433 + } 434 + 435 + /** 436 + * devm_reset_control_bulk_get_optional_shared - resource managed 437 + * reset_control_bulk_get_optional_shared() 438 + * @dev: device to be reset by the controller 439 + * @num_rstcs: number of entries in rstcs array 440 + * @rstcs: array of struct reset_control_bulk_data with reset line names set 441 + * 442 + * Managed reset_control_bulk_get_optional_shared(). For reset controllers 443 + * returned from this function, reset_control_put() is called automatically on 444 + * driver detach. 445 + * 446 + * See reset_control_bulk_get_optional_shared() for more information. 447 + */ 448 + static inline int __must_check 449 + devm_reset_control_bulk_get_optional_shared(struct device *dev, int num_rstcs, 450 + struct reset_control_bulk_data *rstcs) 451 + { 452 + return __devm_reset_control_bulk_get(dev, num_rstcs, rstcs, true, true, false); 728 453 } 729 454 730 455 /**