0

I am not sure this is the best subreddit for this but I'll give it a try. I am trying to generate a PWM-signal on an embedded device running linux. But I have to first apply a patch for this. The issue is I have no idea at all about what I should do with it and how to apply it. This si what I am given:

$ git diff

diff --git a/arch/arm/mach-tegra/board-ardbeg-panel.c b/arch/arm/mach- tegra/board-ardbeg-panel.c
index c7da1e3..f954956 100644
--- a/arch/arm/mach-tegra/board-ardbeg-panel.c
+++ b/arch/arm/mach-tegra/board-ardbeg-panel.c
@@ -765,7 +765,6 @@ static struct tegra_panel      *ardbeg_panel_configure(struct board_info *board_out,
tegra_io_dpd_enable(&dsid_io);
break;
default:
- panel = &dsi_p_wuxga_10_1;
tegra_io_dpd_enable(&dsic_io);
tegra_io_dpd_enable(&dsid_io);
break;
@@ -775,7 +774,7 @@ static struct tegra_panel                      *ardbeg_panel_configure(struct board_info *board_out,
return panel;
}

-static void ardbeg_panel_select(void)
+static struct tegra_panel *ardbeg_panel_select(void)
{
struct tegra_panel *panel = NULL;
struct board_info board;
@@ -828,6 +827,8 @@ static void ardbeg_panel_select(void)
panel->register_i2c_bridge();
}

+ return panel;
+
}
#endif

@@ -837,7 +838,7 @@ int __init ardbeg_panel_init(void)
struct resource __maybe_unused *res;
struct platform_device *phost1x = NULL;
struct board_info board_info;
-
+ struct tegra_panel *panel = NULL;
struct device_node *dc1_node = NULL;
struct device_node *dc2_node = NULL;
#ifdef CONFIG_NVMAP_USE_CMA_FOR_CARVEOUT
@@ -848,7 +849,7 @@ int __init ardbeg_panel_init(void)
find_dc_node(&dc1_node, &dc2_node);

#ifndef CONFIG_TEGRA_HDMI_PRIMARY
- ardbeg_panel_select();
+ panel = ardbeg_panel_select();
#endif

#ifdef CONFIG_TEGRA_NVMAP
@@ -943,8 +944,8 @@ int __init ardbeg_panel_init(void)
tegra_fb2_start, tegra_fb2_size);

#ifndef CONFIG_TEGRA_HDMI_PRIMARY
- if (!of_have_populated_dt() || !dc1_node ||
- !of_device_is_available(dc1_node)) {
+ if (panel && (!of_have_populated_dt() || !dc1_node ||
+ !of_device_is_available(dc1_node))) {
ardbeg_disp1_device.dev.parent = &phost1x->dev;
err = platform_device_register(&ardbeg_disp1_device);
if (err) {

Source: http://elinux.org/Jetson/PWM

I am trying to generate a signal via pwm1

3
  • Do you have the source code? Do you know how to compile the source code?
    – user535733
    Jun 6, 2017 at 21:10
  • @user535733 I have one board-ardbeg-panel.c file
    – traducerad
    Jun 7, 2017 at 0:28
  • See man patch for complete instructions to patch your source using the diff. It's easy. The hard part is that you must then recompile your patched source, and install the compiled binary into your device.
    – user535733
    Jun 7, 2017 at 11:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.