rk3066b: grf add io power domain voltage api

This commit is contained in:
黄涛
2013-03-05 11:54:11 +08:00
parent 71049c2dbd
commit 23de822f96

View File

@@ -1,6 +1,8 @@
#ifndef __MACH_GRF_RK3066B_H
#define __MACH_GRF_RK3066B_H
#include <asm/io.h>
#define GRF_GPIO0L_DIR 0x0000
#define GRF_GPIO0H_DIR 0x0004
#define GRF_GPIO1L_DIR 0x0008
@@ -81,4 +83,31 @@
#define GRF_OS_REG6 0x015c
#define GRF_OS_REG7 0x0160
enum grf_io_power_domain_voltage {
IO_PD_VOLTAGE_3_3V = 0,
IO_PD_VOLTAGE_1_8V = 1,
};
enum grf_io_power_domain {
IO_PD_AP0 = 8,
IO_PD_AP1,
IO_PD_CIF,
IO_PD_FLASH,
IO_PD_VCCIO0,
IO_PD_VCCIO1,
IO_PD_LCDC0,
IO_PD_LCDC1,
};
static inline void grf_set_io_power_domain_voltage(enum grf_io_power_domain pd, enum grf_io_power_domain_voltage volt)
{
writel_relaxed((0x10000 + volt) << pd, RK30_GRF_BASE + GRF_IO_CON4);
dsb();
}
static inline enum grf_io_power_domain_voltage grf_get_io_power_domain_voltage(enum grf_io_power_domain pd)
{
return (readl_relaxed(RK30_GRF_BASE + GRF_IO_CON4) >> pd) & 1;
}
#endif