Skip to content

Commit

Permalink
[Accton] Support ACBEL FSF045 PSU
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Wu <[email protected]>
  • Loading branch information
seanwu-ec committed Jul 13, 2021
1 parent a992d7e commit 64848d7
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,22 +240,23 @@ enum psu_type {
PSU_TYPE_AC_110V,
PSU_TYPE_DC_48V,
PSU_TYPE_DC_12V,
PSU_TYPE_AC_ACBEL_FSF019
PSU_TYPE_AC_ACBEL_FSF019,
PSU_TYPE_AC_ACBEL_FSF045
};

struct model_name_info {
enum psu_type type;
u8 offset;
u8 length;
u8 chk_length;
char* model_name;
};

struct model_name_info models[] = {
{PSU_TYPE_AC_110V, 0x20, 8, 8, "YM-2651Y"},
{PSU_TYPE_DC_48V, 0x20, 8, 8, "YM-2651V"},
{PSU_TYPE_DC_12V, 0x00, 11, 11, "PSU-12V-750"},
{PSU_TYPE_AC_ACBEL_FSF019, 0x15, 10, 7, "FSF019-"}
{PSU_TYPE_AC_110V, 0x20, 8, "YM-2651Y"},
{PSU_TYPE_DC_48V, 0x20, 8, "YM-2651V"},
{PSU_TYPE_DC_12V, 0x00, 11, "PSU-12V-750"},
{PSU_TYPE_AC_ACBEL_FSF019, 0x15, 10, "FSF019-"},
{PSU_TYPE_AC_ACBEL_FSF045, 0x15, 10, "FSF045-"}
};

static int as7326_56x_psu_model_name_get(struct device *dev)
Expand All @@ -281,7 +282,7 @@ static int as7326_56x_psu_model_name_get(struct device *dev)

/* Determine if the model name is known, if not, read next index
*/
if (strncmp(data->model_name, models[i].model_name, models[i].chk_length) == 0) {
if (strncmp(data->model_name, models[i].model_name, strlen(models[i].model_name)) == 0) {
return 0;
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,22 +240,23 @@ enum psu_type {
PSU_TYPE_AC_110V,
PSU_TYPE_DC_48V,
PSU_TYPE_DC_12V,
PSU_TYPE_AC_ACBEL_FSF019
PSU_TYPE_AC_ACBEL_FSF019,
PSU_TYPE_AC_ACBEL_FSF045
};

struct model_name_info {
enum psu_type type;
u8 offset;
u8 length;
u8 chk_length;
char* model_name;
};

struct model_name_info models[] = {
{PSU_TYPE_AC_110V, 0x20, 8, 8, "YM-2651Y"},
{PSU_TYPE_DC_48V, 0x20, 8, 8, "YM-2651V"},
{PSU_TYPE_DC_12V, 0x00, 11, 11, "PSU-12V-750"},
{PSU_TYPE_AC_ACBEL_FSF019, 0x15, 10, 7, "FSF019-"}
{PSU_TYPE_AC_110V, 0x20, 8, "YM-2651Y"},
{PSU_TYPE_DC_48V, 0x20, 8, "YM-2651V"},
{PSU_TYPE_DC_12V, 0x00, 11, "PSU-12V-750"},
{PSU_TYPE_AC_ACBEL_FSF019, 0x15, 10, "FSF019-"},
{PSU_TYPE_AC_ACBEL_FSF045, 0x15, 10, "FSF045-"}
};

static int as7712_32x_psu_model_name_get(struct device *dev)
Expand All @@ -281,7 +282,7 @@ static int as7712_32x_psu_model_name_get(struct device *dev)

/* Determine if the model name is known, if not, read next index
*/
if (strncmp(data->model_name, models[i].model_name, models[i].chk_length) == 0) {
if (strncmp(data->model_name, models[i].model_name, strlen(models[i].model_name)) == 0) {
return 0;
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,22 +249,23 @@ enum psu_type {
PSU_TYPE_AC_110V,
PSU_TYPE_DC_48V,
PSU_TYPE_DC_12V,
PSU_TYPE_AC_ACBEL_FSF019
PSU_TYPE_AC_ACBEL_FSF019,
PSU_TYPE_AC_ACBEL_FSF045
};

struct model_name_info {
enum psu_type type;
u8 offset;
u8 length;
u8 chk_length;
char* model_name;
};

struct model_name_info models[] = {
{PSU_TYPE_AC_110V, 0x20, 8, 8, "YM-2651Y"},
{PSU_TYPE_DC_48V, 0x20, 8, 8, "YM-2651V"},
{PSU_TYPE_DC_12V, 0x00, 11, 11, "PSU-12V-750"},
{PSU_TYPE_AC_ACBEL_FSF019, 0x15, 10, 7, "FSF019-"}
{PSU_TYPE_AC_110V, 0x20, 8, "YM-2651Y"},
{PSU_TYPE_DC_48V, 0x20, 8, "YM-2651V"},
{PSU_TYPE_DC_12V, 0x00, 11, "PSU-12V-750"},
{PSU_TYPE_AC_ACBEL_FSF019, 0x15, 10, "FSF019-"},
{PSU_TYPE_AC_ACBEL_FSF045, 0x15, 10, "FSF045-"}
};

static int as7716_32x_psu_model_name_get(struct device *dev)
Expand All @@ -290,7 +291,7 @@ static int as7716_32x_psu_model_name_get(struct device *dev)

/* Determine if the model name is known, if not, read next index
*/
if (strncmp(data->model_name, models[i].model_name, models[i].chk_length) == 0) {
if (strncmp(data->model_name, models[i].model_name, strlen(models[i].model_name)) == 0) {
return 0;
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,22 +240,23 @@ enum psu_type {
PSU_TYPE_AC_110V,
PSU_TYPE_DC_48V,
PSU_TYPE_DC_12V,
PSU_TYPE_AC_ACBEL_FSF019
PSU_TYPE_AC_ACBEL_FSF019,
PSU_TYPE_AC_ACBEL_FSF045
};

struct model_name_info {
enum psu_type type;
u8 offset;
u8 length;
u8 chk_length;
char* model_name;
};

struct model_name_info models[] = {
{PSU_TYPE_AC_110V, 0x20, 8, 8, "YM-2651Y"},
{PSU_TYPE_DC_48V, 0x20, 8, 8, "YM-2651V"},
{PSU_TYPE_DC_12V, 0x00, 11, 11, "PSU-12V-750"},
{PSU_TYPE_AC_ACBEL_FSF019, 0x15, 10, 7, "FSF019-"}
{PSU_TYPE_AC_110V, 0x20, 8, "YM-2651Y"},
{PSU_TYPE_DC_48V, 0x20, 8, "YM-2651V"},
{PSU_TYPE_DC_12V, 0x00, 11, "PSU-12V-750"},
{PSU_TYPE_AC_ACBEL_FSF019, 0x15, 10, "FSF019-"},
{PSU_TYPE_AC_ACBEL_FSF045, 0x15, 10, "FSF045-"}
};

static int as7726_32x_psu_model_name_get(struct device *dev)
Expand All @@ -281,7 +282,7 @@ static int as7726_32x_psu_model_name_get(struct device *dev)

/* Determine if the model name is known, if not, read next index
*/
if (strncmp(data->model_name, models[i].model_name, models[i].chk_length) == 0) {
if (strncmp(data->model_name, models[i].model_name, strlen(models[i].model_name)) == 0) {
return 0;
}
else {
Expand Down

0 comments on commit 64848d7

Please sign in to comment.