我不确定这是否是这方面的最佳 subreddit,但我会尝试一下。我正在尝试在运行 Linux 的嵌入式设备上生成 PWM 信号。但我必须先为此应用补丁。问题是我完全不知道我应该用它做什么以及如何应用它。这是我得到的:
$ 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) {
来源:http://elinux.org/Jetson/PWM
我正在尝试通过 pwm1 生成信号