params.c (1e6b98ebd458e63b9effda2feb696e36644d4eed) | params.c (38e9002b85672352f8693c82192c8029586dd86d) |
---|---|
1/* 2 * Copyright (C) 2004-2016 Synopsys, Inc. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions, and the following disclaimer, --- 728 unchanged lines hidden (view full) --- 737{ 738 return hsotg->params.phy_type; 739} 740 741static void dwc2_set_param_speed(struct dwc2_hsotg *hsotg, int val) 742{ 743 int valid = 1; 744 | 1/* 2 * Copyright (C) 2004-2016 Synopsys, Inc. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions, and the following disclaimer, --- 728 unchanged lines hidden (view full) --- 737{ 738 return hsotg->params.phy_type; 739} 740 741static void dwc2_set_param_speed(struct dwc2_hsotg *hsotg, int val) 742{ 743 int valid = 1; 744 |
745 if (DWC2_OUT_OF_BOUNDS(val, 0, 1)) { | 745 if (DWC2_OUT_OF_BOUNDS(val, 0, 2)) { |
746 if (val >= 0) { 747 dev_err(hsotg->dev, "Wrong value for speed parameter\n"); | 746 if (val >= 0) { 747 dev_err(hsotg->dev, "Wrong value for speed parameter\n"); |
748 dev_err(hsotg->dev, "max_speed parameter must be 0 or 1\n"); | 748 dev_err(hsotg->dev, "max_speed parameter must be 0, 1, or 2\n"); |
749 } 750 valid = 0; 751 } 752 | 749 } 750 valid = 0; 751 } 752 |
753 if (dwc2_is_hs_iot(hsotg) && 754 val == DWC2_SPEED_PARAM_LOW) 755 valid = 0; 756 |
|
753 if (val == DWC2_SPEED_PARAM_HIGH && 754 dwc2_get_param_phy_type(hsotg) == DWC2_PHY_TYPE_PARAM_FS) 755 valid = 0; 756 757 if (!valid) { 758 if (val >= 0) 759 dev_err(hsotg->dev, 760 "%d invalid for speed parameter. Check HW configuration.\n", --- 671 unchanged lines hidden --- | 757 if (val == DWC2_SPEED_PARAM_HIGH && 758 dwc2_get_param_phy_type(hsotg) == DWC2_PHY_TYPE_PARAM_FS) 759 valid = 0; 760 761 if (!valid) { 762 if (val >= 0) 763 dev_err(hsotg->dev, 764 "%d invalid for speed parameter. Check HW configuration.\n", --- 671 unchanged lines hidden --- |