mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-14 17:07:38 +00:00
reset: reset-hisilicon: also handle #reset-cells = <2>
It's also valid to have #reset-cells = <2> while the third arg defaults to ASSERT_SET. Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
This commit is contained in:
parent
aeba385e41
commit
53c3e38606
1 changed files with 13 additions and 2 deletions
|
@ -49,7 +49,18 @@ static int hisi_reset_assert(struct reset_ctl *rst)
|
|||
static int hisi_reset_of_xlate(struct reset_ctl *rst,
|
||||
struct ofnode_phandle_args *args)
|
||||
{
|
||||
if (args->args_count != 3) {
|
||||
unsigned long polarity;
|
||||
|
||||
switch (args->args_count) {
|
||||
case 2:
|
||||
polarity = ASSERT_SET;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
polarity = args->args[2];
|
||||
break;
|
||||
|
||||
default:
|
||||
debug("Invalid args_count: %d\n", args->args_count);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -57,7 +68,7 @@ static int hisi_reset_of_xlate(struct reset_ctl *rst,
|
|||
/* Use .data field as register offset and .id field as bit shift */
|
||||
rst->data = args->args[0];
|
||||
rst->id = args->args[1];
|
||||
rst->polarity = args->args[2];
|
||||
rst->polarity = polarity;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue