应一个客户需求,4418安卓系统适配pcf8563芯片。由于安卓系统的linux内核是3.4.39版本,并没有支持设备树,所以修改完配置文件,还需要在板级文件进行配置。
修改配置文件:
--- a/linux/kernel/kernel-3.4.39/arch/arm/configs/s5p4418_drone_android_lollipop_defconfig
+++ b/linux/kernel/kernel-3.4.39/arch/arm/configs/s5p4418_drone_android_lollipop_defconfig
@@ -2576,14 +2576,14 @@ CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_DRV_ISL1208 is not set
# CONFIG_RTC_DRV_ISL12022 is not set
# CONFIG_RTC_DRV_X1205 is not set
-# CONFIG_RTC_DRV_PCF8563 is not set
+CONFIG_RTC_DRV_PCF8563=y
# CONFIG_RTC_DRV_PCF8583 is not set
# CONFIG_RTC_DRV_M41T80 is not set
# CONFIG_RTC_DRV_BQ32K is not set
# CONFIG_RTC_DRV_S35390A is not set
# CONFIG_RTC_DRV_FM3130 is not set
# CONFIG_RTC_DRV_RX8581 is not set
-CONFIG_RTC_DRV_RX8010=y
+#CONFIG_RTC_DRV_RX8010=y
# CONFIG_RTC_DRV_RX8025 is not set
# CONFIG_RTC_DRV_EM3027 is not set
# CONFIG_RTC_DRV_RV3029C2 is not set
修改板级文件,添加iic地址等:
--- a/linux/kernel/kernel-3.4.39/arch/arm/plat-s5p4418/drone/device.c
+++ b/linux/kernel/kernel-3.4.39/arch/arm/plat-s5p4418/drone/device.c
@@ -437,7 +437,12 @@ static struct i2c_board_info __initdata rx8010_i2c_bdi = {
#endif
+#if defined(CONFIG_RTC_DRV_PCF8563)
+static struct i2c_board_info __initdata pcf8563_i2c_bdi = {
+ I2C_BOARD_INFO("pcf8563", 0x51)
+};
+#endif
/*------------------------------------------------------------------------------
* backlight : generic pwm device
*/
@@ -1951,6 +1956,10 @@ void __init nxp_board_devices_register(void)
printk("plat: add device rx8010\n");
i2c_register_board_info(1, &rx8010_i2c_bdi, 1);
#endif
+#if defined(CONFIG_RTC_DRV_PCF8563)
+ printk("plat: add device pcf8563\n");
+ i2c_register_board_info(1, &pcf8563_i2c_bdi, 1);
+#endif
对比设备树中的操作,其实是同样的效果,但是设备树的更加简洁,设备树的好处又凸显了。
hym8563@51{
compatible = "sntech,hym8563";
reg = <0x51>;
status = "okay";
};
对于8563这个芯片的支持就是改上面这些