pastebin - collaborative debugging tool
eckelmann.kpaste.net RSS


barebox init motor bridges 20190403
Posted by Anonymous on Wed 3rd Apr 2019 12:34
raw | new post

  1. diff --git a/arch/arm/boards/eag-mx25/board.c b/arch/arm/boards/eag-mx25/board.c
  2. index 6c1117b..086d61b 100644
  3. --- a/arch/arm/boards/eag-mx25/board.c
  4. +++ b/arch/arm/boards/eag-mx25/board.c
  5. @@ -188,6 +188,26 @@ static void imx25_eag_ecu01_fb_register(void)
  6.         imx25_add_fb(&imx25_eag_ecu01_fb_data);
  7.  }
  8.  
  9. +static void imx25_eag_ecu01_motor_bridge(void)
  10. +{
  11. +        const struct gpio motorbridge_gpios[] = {
  12. +               /* first init { enable_A, enable_B }, then { clockwise, counter_clockwise } */
  13. +                { IMX_GPIO_NR(1, 10),  GPIOF_OUT_INIT_LOW, "motorbridge1/enable_A"             },
  14. +                { IMX_GPIO_NR(2, 22),  GPIOF_OUT_INIT_LOW, "motorbridge1/enable_B"             },
  15. +                { IMX_GPIO_NR(2, 21),  GPIOF_OUT_INIT_LOW, "motorbridge1/clockwise"            },
  16. +                { IMX_GPIO_NR(1, 8),   GPIOF_OUT_INIT_LOW, "motorbridge1/counter_clockwise"    },
  17. +
  18. +                { IMX_GPIO_NR(4, 29),  GPIOF_OUT_INIT_LOW, "motorbridge2/enable_A"             },
  19. +                { IMX_GPIO_NR(3, 15),  GPIOF_OUT_INIT_LOW, "motorbridge2/enable_B"             },
  20. +                { IMX_GPIO_NR(1, 9),   GPIOF_OUT_INIT_LOW, "motorbridge2/clockwise"            },
  21. +                { IMX_GPIO_NR(1, 7),   GPIOF_OUT_INIT_LOW, "motorbridge2/counter_clockwise"    },
  22. +        };
  23. +
  24. +       (void)gpio_request_array(motorbridge_gpios, ARRAY_SIZE(motorbridge_gpios));
  25. +
  26. +       dputs(2, "#### imx25_eag_ecu01_motor_bridge\n");
  27. +}
  28. +
  29.  static int imx25_eag_init(void)
  30.  {
  31.         if (!of_machine_is_compatible("eckelmann,imx25"))
  32. @@ -204,6 +224,7 @@ static int imx25_eag_init(void)
  33.         }
  34.         else if (of_machine_is_compatible("eckelmann,ecu01")) {
  35.                 barebox_set_hostname("ecu01");
  36. +               imx25_eag_ecu01_motor_bridge();
  37.                 imx25_eag_ecu01_fb_register();
  38.                 armlinux_set_architecture(MACH_TYPE_EAG_ECU01);
  39.         }

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at