Skip to content

Commit

Permalink
usb: device: class: gs_usb: fix tseg2/dtseg2 maximum value assignment
Browse files Browse the repository at this point in the history
Fix the assignment of the maximum value for tseg2/dtseg2.

Signed-off-by: Henrik Brix Andersen <[email protected]>
  • Loading branch information
henrikbrixandersen committed Sep 24, 2024
1 parent 67081a5 commit c25bdd3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions subsys/usb/device/class/gs_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static int gs_usb_request_bt_const(const struct device *dev, uint16_t ch, int32_
bt_const->tseg1_min = sys_cpu_to_le32(min->prop_seg + min->phase_seg1);
bt_const->tseg1_max = sys_cpu_to_le32(max->prop_seg + max->phase_seg1);
bt_const->tseg2_min = sys_cpu_to_le32(min->phase_seg2);
bt_const->tseg2_max = sys_cpu_to_le32(max->phase_seg1);
bt_const->tseg2_max = sys_cpu_to_le32(max->phase_seg2);
bt_const->sjw_max = sys_cpu_to_le32(max->sjw);
bt_const->brp_min = sys_cpu_to_le32(min->prescaler);
bt_const->brp_max = sys_cpu_to_le32(max->prescaler);
Expand Down Expand Up @@ -173,7 +173,7 @@ static int gs_usb_request_bt_const_ext(const struct device *dev, uint16_t ch, in
bt_const_ext->tseg1_min = sys_cpu_to_le32(min->prop_seg + min->phase_seg1);
bt_const_ext->tseg1_max = sys_cpu_to_le32(max->prop_seg + max->phase_seg1);
bt_const_ext->tseg2_min = sys_cpu_to_le32(min->phase_seg2);
bt_const_ext->tseg2_max = sys_cpu_to_le32(max->phase_seg1);
bt_const_ext->tseg2_max = sys_cpu_to_le32(max->phase_seg2);
bt_const_ext->sjw_max = sys_cpu_to_le32(max->sjw);
bt_const_ext->brp_min = sys_cpu_to_le32(min->prescaler);
bt_const_ext->brp_max = sys_cpu_to_le32(max->prescaler);
Expand All @@ -190,7 +190,7 @@ static int gs_usb_request_bt_const_ext(const struct device *dev, uint16_t ch, in
bt_const_ext->dtseg1_min = sys_cpu_to_le32(min->prop_seg + min->phase_seg1);
bt_const_ext->dtseg1_max = sys_cpu_to_le32(max->prop_seg + max->phase_seg1);
bt_const_ext->dtseg2_min = sys_cpu_to_le32(min->phase_seg2);
bt_const_ext->dtseg2_max = sys_cpu_to_le32(max->phase_seg1);
bt_const_ext->dtseg2_max = sys_cpu_to_le32(max->phase_seg2);
bt_const_ext->dsjw_max = sys_cpu_to_le32(max->sjw);
bt_const_ext->dbrp_min = sys_cpu_to_le32(min->prescaler);
bt_const_ext->dbrp_max = sys_cpu_to_le32(max->prescaler);
Expand Down
6 changes: 3 additions & 3 deletions subsys/usb/device_next/class/gs_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static int gs_usb_request_bt_const(const struct device *dev, uint16_t ch, struct
bt_const.tseg1_min = sys_cpu_to_le32(min->prop_seg + min->phase_seg1);
bt_const.tseg1_max = sys_cpu_to_le32(max->prop_seg + max->phase_seg1);
bt_const.tseg2_min = sys_cpu_to_le32(min->phase_seg2);
bt_const.tseg2_max = sys_cpu_to_le32(max->phase_seg1);
bt_const.tseg2_max = sys_cpu_to_le32(max->phase_seg2);
bt_const.sjw_max = sys_cpu_to_le32(max->sjw);
bt_const.brp_min = sys_cpu_to_le32(min->prescaler);
bt_const.brp_max = sys_cpu_to_le32(max->prescaler);
Expand Down Expand Up @@ -176,7 +176,7 @@ static int gs_usb_request_bt_const_ext(const struct device *dev, uint16_t ch,
bt_const_ext.tseg1_min = sys_cpu_to_le32(min->prop_seg + min->phase_seg1);
bt_const_ext.tseg1_max = sys_cpu_to_le32(max->prop_seg + max->phase_seg1);
bt_const_ext.tseg2_min = sys_cpu_to_le32(min->phase_seg2);
bt_const_ext.tseg2_max = sys_cpu_to_le32(max->phase_seg1);
bt_const_ext.tseg2_max = sys_cpu_to_le32(max->phase_seg2);
bt_const_ext.sjw_max = sys_cpu_to_le32(max->sjw);
bt_const_ext.brp_min = sys_cpu_to_le32(min->prescaler);
bt_const_ext.brp_max = sys_cpu_to_le32(max->prescaler);
Expand All @@ -193,7 +193,7 @@ static int gs_usb_request_bt_const_ext(const struct device *dev, uint16_t ch,
bt_const_ext.dtseg1_min = sys_cpu_to_le32(min->prop_seg + min->phase_seg1);
bt_const_ext.dtseg1_max = sys_cpu_to_le32(max->prop_seg + max->phase_seg1);
bt_const_ext.dtseg2_min = sys_cpu_to_le32(min->phase_seg2);
bt_const_ext.dtseg2_max = sys_cpu_to_le32(max->phase_seg1);
bt_const_ext.dtseg2_max = sys_cpu_to_le32(max->phase_seg2);
bt_const_ext.dsjw_max = sys_cpu_to_le32(max->sjw);
bt_const_ext.dbrp_min = sys_cpu_to_le32(min->prescaler);
bt_const_ext.dbrp_max = sys_cpu_to_le32(max->prescaler);
Expand Down

0 comments on commit c25bdd3

Please sign in to comment.