迅为4412开发板-驱动-电源管理芯片S5M8767修改输出例程

本文档介绍,如何修改和控制 S5M8767,以 camera 扩展端子的 VDD28_AF,VDD28_CAM 为例,来具体介绍驱动中如何实现电源修改和控制。
另外还有一个文档“iTOP-4412-驱动-电源管理芯片修改输出电压”,用户可以在技术支持群中搜到,其中涉及到具体结构的分析,也很有参考价值。
本文档以具体的驱动小例程介绍在已经配置好的源码中做修改,用户可以将其集成到自己的驱动中,也提供了驱动测试例程压缩包“power_s5m8767a.tar.gz”。
1. 硬件分析
1.1 原理图分析
如下图所示,在底板原理图中找到 camera 扩展端子,这里以 VDD28_AF,VDD28_CAM 为例。camera 摄像头驱动中需要将其设置为 2.8v 的电压,后面我们将其修改为 3.3v 输出(需要去掉 camera 摄像头驱动)。
ret = -ENODEV;
goto err_regulator;
}
ov_vdd28_cam_regulator = regulator_get(NULL, "vdda28_2m");
if (IS_ERR(ov_vdd28_cam_regulator)) {
printk("%s: failed to get %s ", __func__, "vdda28_2m");
ret = -ENODEV;
goto err_regulator;
}
ov_vddaf_cam_regulator = regulator_get(NULL, "vdd28_af");
if (IS_ERR(ov_vddaf_cam_regulator)) {
printk("%s: failed to get %s ", __func__, "vdd28_af");
ret = -ENODEV;
goto err_regulator;
}
ov_vdd5m_cam_regulator = regulator_get(NULL, "vdd28_cam");
if (IS_ERR(ov_vdd5m_cam_regulator)) {
printk("%s: failed to get %s ", __func__, "vdd28_cam");
ret = -ENODEV;
goto err_regulator;
}
err_regulator:
regulator_put(ov_vddaf_cam_regulator);
regulator_put(ov_vdd5m_cam_regulator);
regulator_put(ov_vdd18_cam_regulator);
regulator_put(ov_vdd28_cam_regulator);
}
static int hello_init(void)
{
power_init();
power(1);
printk(KERN_EMERG "Hello World enter! ");
return 0;
}
static void hello_exit(void)
{
power(0);
printk(KERN_EMERG "Hello world exit! ");
}
module_init(hello_init);
module_exit(hello_exit);
Makefile 如下所示。
#!/bin/bash
obj-m += power_s5m8767a_test.o
KDIR := /home/topeet/android4.0/iTop4412_Kernel_3.0
PWD ?= $(shell pwd)
all:
make -C $(KDIR) M=$(PWD) modules
clean:
rm -rf *.o modules.order *.ko *mod.c Module.symvers
使用 make 命令编译驱动模块,如下图所示。
Linux的系统框架: https://www.bilibili.com/video/BV1HE411w7by?p=2
接下来可以做一些实践了,比如编译系统的安装、编译以及烧写;这些可以按照迅为的视频教程来学习,也可以参考多达2300页的用户使用手册。
入门篇:https://www.bilibili.com/video/B ... 7086078002054549963
另外,迅为提供了广受赞誉的QT入门教程:  
QT学习篇:https://www.bilibili.com/video/B ... 7086078002054549963
接下来可以学习一下驱动相关技术:  
Linux驱动专题:https://www.bilibili.com/video/B ... 2661886997282795316
再往下是非常接地气的实战教程:
机车导航项目:https://www.bilibili.com/video/B ... 7086078002054549963
云服务器智能家居:https://www.bilibili.com/video/B ... 7086078002054549963
按这样的路线图学下来,在迅为强大售后的帮助下,相信你很快跨入嵌入式开发的大门!