Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to modify the Voltage output of Power Management Chip 8767 by Android

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

The knowledge of this article "Android how to modify the voltage output of power management chip 8767" is not understood by most people, so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how Android modifies the voltage output of power management chip 8767".

S5M8767 power management chip is specially developed by Samsung for 4412. S5M8767 provides 9-channel BUCK and 28-channel LDO output, and the voltage of each channel can be set by software. Here we take Xunwei-4412 elite backplane VDD28_AF,VDD28_CAM as an example.

Schematic analysis

Find the camera expansion terminal in the schematic diagram of the backplane, and set the voltage of these two circuits to 2.8v in the camera camera driver. So when we modify the voltage of these two channels in the future, we have to remove the camera driver first.

According to the schematic diagram of the core board, VDD28_AF and VDD28_CAM correspond to the VLDO20 and VLDO21 of the power chip S5M8767A respectively. As shown in the following figure:

Then we open the datasheet of 8767 and find the description of these two paths. the red box at the top of the picture below indicates that the output current is 150mA, the lowest output voltage is 0.8v and the maximum voltage is 3.95v. In the bottom red box, the default output voltage is described, you can see LDO20 and LDO21, and the default output is 3.0v. As shown in the following figure:

Software analysis

After determining the hardware principle, we know that the voltage range of these two circuits is 0.8v to 3.95v. Then we open the platform file in the kernel source code.

Platform file location:

Rch/arm/mach-exynos/mach-itop4412.c

Then we find the code corresponding to ldo20 and ldo21, as shown in the following figure:

We modify the code 2800000 in the red box to 3950000, the first parameter in the red box function represents the 20th path of the 8767 power chip, the third parameter represents the lowest output voltage, and the fourth parameter represents the highest output voltage.

Finally, we have to remove 5640 of the drivers from the menuconfig. In this way the configuration of our software is complete.

test

The test code is as follows:

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

Struct regulator * ov_vddaf_cam_regulator = NULL

Struct regulator * ov_vdd5m_cam_regulator = NULL

Struct regulator * ov_vdd18_cam_regulator = NULL

Struct regulator * ov_vdd28_cam_regulator = NULL

MODULE_LICENSE ("Dual BSD/GPL")

MODULE_AUTHOR ("iTOPEET_dz")

Static int power (int flag)

{

If (1 = = flag) {regulator_enable (ov_vdd18_cam_regulator)

Udelay (10)

Regulator_enable (ov_vdd28_cam_regulator)

Udelay (10)

Regulator_enable (ov_vdd5m_cam_regulator); / / DOVDD DVDD 1.8v

Udelay (10)

Regulator_enable (ov_vddaf_cam_regulator); / / AVDD 2.8v

Udelay (10)

}

Else if (0 = = flag) {

Regulator_disable (ov_vdd18_cam_regulator)

Udelay (10)

Regulator_disable (ov_vdd28_cam_regulator)

Udelay (10); regulator_disable (ov_vdd5m_cam_regulator)

Udelay (10); regulator_disable (ov_vddaf_cam_regulator)

Udelay (10)

}

Return 0

}

Static void power_init (void)

{

Int ret

Ov_vdd18_cam_regulator = regulator_get (NULL, "vdd18_cam")

If (IS_ERR (ov_vdd18_cam_regulator)) {

Printk ("% s: failed to get% s\ n", _ _ func__, "vdd18_cam")

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\ n", _ _ 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\ n", _ _ 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\ n", _ _ 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!\ n")

Return 0

}

Static void hello_exit (void)

{

Power (0)

Printk (KERN_EMERG "Hello world exit!\ n")

}

Module_init (hello_init)

Module_exit (hello_exit)

The Makefile is shown below.

#! / bin/bash

Obj-m + = power_s5m8767a_test.o

KDIR: = / home/topeet/android4.0/iTop4412_Kernel_3.0

PWD? = $(shell pwd)

All:

Make-C $(KDIR) masking $(PWD) modules

Clean:

Rm-rf * .o modules.order * .ko * mod.c Module.symvers

After we load the driver, the measured voltage is about 3V, there is a voltage drop, and after unloading the driver, the voltage is 0. Explain that the driver runs successfully, if you need to use power control in your own project, you can also refer to this routine to achieve.

The above is about "how Android modifies the voltage output of power management chip 8767". I believe we all have some understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report