• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ IO_TO_VIRT函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中IO_TO_VIRT函数的典型用法代码示例。如果您正苦于以下问题:C++ IO_TO_VIRT函数的具体用法?C++ IO_TO_VIRT怎么用?C++ IO_TO_VIRT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了IO_TO_VIRT函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: tegra_init_fuse

void tegra_init_fuse(void)
{
	u32 reg = readl(IO_TO_VIRT(TEGRA_CLK_RESET_BASE + 0x48));
	reg |= 1 << 28;
	writel(reg, IO_TO_VIRT(TEGRA_CLK_RESET_BASE + 0x48));
	tegra_init_speedo_data();

	pr_info("Tegra Revision: %s SKU: %d CPU Process: %d Core Process: %d\n",
		tegra_revision_name[tegra_get_revision()],
		tegra_sku_id(), tegra_cpu_process_id(),
		tegra_core_process_id());
}
开发者ID:123456798wil,项目名称:kernel_dell_streak7,代码行数:12,代码来源:fuse.c


示例2: tegra_vi_csi_readl

int tegra_vi_csi_readl(u32 offset, u32 *val)
{
	if (vi_clk == NULL) {
		vi_clk = tegra_get_clock_by_name("vi");
		if (IS_ERR_OR_NULL(vi_clk)) {
			pr_err("vi: can't get vi clock\n");
			return -EINVAL;
		}
	}
	tegra_clk_prepare_enable(vi_clk);

	if (csi_clk == NULL) {
		csi_clk = tegra_get_clock_by_name("csi");
		if (IS_ERR_OR_NULL(csi_clk)) {
			pr_err("csi: can't get csi clock\n");
			return -EINVAL;
		}
	}
	tegra_clk_prepare_enable(csi_clk);

	*val = readl(IO_TO_VIRT(TEGRA_VI_BASE) + offset * 4);

	tegra_clk_disable_unprepare(csi_clk);
	tegra_clk_disable_unprepare(vi_clk);

	return 0;
}
开发者ID:0xroot,项目名称:Blackphone-BP1-Kernel,代码行数:27,代码来源:csi.c


示例3: tegra_apb_readl

u32 tegra_apb_readl(unsigned long offset)
{
	struct tegra_dma_req req;
	int ret;

	if (!tegra_apb_dma && !tegra_apb_init())
		return readl(IO_TO_VIRT(offset));

	mutex_lock(&tegra_apb_dma_lock);
	req.complete = apb_dma_complete;
	req.to_memory = 1;
	req.dest_addr = tegra_apb_bb_phys;
	req.dest_bus_width = 32;
	req.dest_wrap = 1;
	req.source_addr = offset;
	req.source_bus_width = 32;
	req.source_wrap = 4;
	req.req_sel = TEGRA_DMA_REQ_SEL_CNTR;
	req.size = 4;

	INIT_COMPLETION(tegra_apb_wait);

	tegra_dma_enqueue_req(tegra_apb_dma, &req);

	ret = wait_for_completion_timeout(&tegra_apb_wait,
		msecs_to_jiffies(50));

	if (WARN(ret == 0, "apb read dma timed out")) {
		tegra_dma_dequeue_req(tegra_apb_dma, &req);
		*(u32 *)tegra_apb_bb = 0;
	}

	mutex_unlock(&tegra_apb_dma_lock);
	return *((u32 *)tegra_apb_bb);
}
开发者ID:Blackburn29,项目名称:PsycoKernel,代码行数:35,代码来源:apbio.c


示例4: apb_writel

static inline void apb_writel(u32 value, unsigned long offset)
{
    struct tegra_dma_req req;
    int ret;

    if (!tegra_apb_dma) {
        writel(value, IO_TO_VIRT(offset));
        return;
    }

    mutex_lock(&tegra_apb_dma_lock);
    *((u32 *)tegra_apb_bb) = value;
    req.complete = apb_dma_complete;
    req.to_memory = 0;
    req.dest_addr = offset;
    req.dest_wrap = 4;
    req.dest_bus_width = 32;
    req.source_addr = tegra_apb_bb_phys;
    req.source_bus_width = 32;
    req.source_wrap = 1;
    req.req_sel = 0;
    req.size = 4;

    INIT_COMPLETION(tegra_apb_wait);

    tegra_dma_enqueue_req(tegra_apb_dma, &req);

    ret = wait_for_completion_timeout(&tegra_apb_wait,
                                      msecs_to_jiffies(400));

    if (WARN(ret == 0, "apb write dma timed out"))
        tegra_dma_dequeue_req(tegra_apb_dma, &req);

    mutex_unlock(&tegra_apb_dma_lock);
}
开发者ID:jbaldus,项目名称:android_kernel_a100,代码行数:35,代码来源:apbio.c


示例5: tegra_mc_set_priority

void tegra_mc_set_priority(unsigned long client, unsigned long prio)
{
	unsigned long mc_base = IO_TO_VIRT(TEGRA_MC_BASE);
	unsigned long reg = client >> 8;
	int field = client & 0xff;
	unsigned long val;
	unsigned long flags;

	spin_lock_irqsave(&tegra_mc_lock, flags);
	val = readl(mc_base + reg);
	val &= ~(TEGRA_MC_PRIO_MASK << field);
	val |= prio << field;
	writel(val, mc_base + reg);
	spin_unlock_irqrestore(&tegra_mc_lock, flags);
}
开发者ID:123456798wil,项目名称:kernel_dell_streak7,代码行数:15,代码来源:mc.c


示例6: utmip_temp_dep_update

static void utmip_temp_dep_update(int curr_rtemp, int utmip_temp_bound)
{
	static int prev_temp;
	static char initial_update = 1;
	unsigned int fuse_usb_calib_value = s_fuse_usb_calib_value;
	int i;
	char utmip_update_require = 0;

	/* Extract bits[3:0]. */
	fuse_usb_calib_value = fuse_usb_calib_value & 0xF;

	/* If previous and currentt temperatures falls in the same temperature
	   boundary then no need to update the  UTMIP_SPARE_CFG */
	if ((prev_temp >= utmip_temp_bound) && (curr_rtemp >= utmip_temp_bound))
		utmip_update_require = 0;
	else if ((prev_temp < utmip_temp_bound) &&
				(curr_rtemp < utmip_temp_bound))
		utmip_update_require = 0;
	else
		utmip_update_require = 1;

	/*  For Initial call , need to update the UTMIP_SPARE_CFG */
	if (initial_update) {
		utmip_update_require = 1;
		initial_update = 0;
		prev_temp = curr_rtemp;
	}

	if (utmip_update_require) {
		prev_temp = curr_rtemp;
		if (curr_rtemp >= utmip_temp_bound) {
			fuse_usb_calib_value += 0x1;
			/*  Check if there is a overflow. */
			if (fuse_usb_calib_value > UTMIP_XCVR_SETUP_MAX_VAL)
				fuse_usb_calib_value = UTMIP_XCVR_SETUP_MAX_VAL;
		}

		for (i = 0; i < ARRAY_SIZE(s_tegra_usb_base); i++) {
			unsigned int regval;
			regval = readl(IO_TO_VIRT(s_tegra_usb_base[i] +
					UTMIP_SPARE_CFG0));
			regval &= ~FUSE_SETUP_SEL;
			writel(regval, IO_TO_VIRT(s_tegra_usb_base[i] +
					UTMIP_SPARE_CFG0));

			regval = readl(IO_TO_VIRT(s_tegra_usb_base[i] +
					UTMIP_XCVR_CFG0));
			/* If low_to_high, then write 0x2 to HSSLEW_MSB
			 else write 0x8 */
			regval &= ~UTMIP_XCVR_HSSLEW_MSB_MSK;
			regval |= (curr_rtemp >= utmip_temp_bound) ?
					UTMIP_XCVR_HSSLEW_MSB_HIGH_TEMP_VAL :
					UTMIP_XCVR_HSSLEW_MSB_LOW_TEMP_VAL;
			/* write fuse_usb_calib_value to SETUP field
			of UTMIP_XCVR_CFG0. */
			regval &= ~UTMIP_XCVR_SETUP_MSK;
			regval |= fuse_usb_calib_value;
			writel(regval, IO_TO_VIRT(s_tegra_usb_base[i] +
					UTMIP_XCVR_CFG0));
		}
	}
}
开发者ID:Beta1440,项目名称:Sublime-N9,代码行数:62,代码来源:therm-monitor.c


示例7: pg_writel

static inline void pg_writel(unsigned long value, unsigned long offset)
{
	writel(value, IO_TO_VIRT(TEGRA_APB_MISC_BASE) + offset);
}
开发者ID:Beta1440,项目名称:Sublime-N9,代码行数:4,代码来源:therm-monitor.c


示例8: get_fuse_usb_calib_value

static void get_fuse_usb_calib_value(void)
{
	s_fuse_usb_calib_value = readl(IO_TO_VIRT(TEGRA_FUSE_BASE +
						FUSE_USB_CALIB_0));
}
开发者ID:Beta1440,项目名称:Sublime-N9,代码行数:5,代码来源:therm-monitor.c


示例9: gizmo_writel

static inline void gizmo_writel(unsigned long value, unsigned long offset)
{
	writel(value, IO_TO_VIRT(TEGRA_AHB_GIZMO_BASE + offset));
}
开发者ID:binkybear,项目名称:kangaroo,代码行数:4,代码来源:common.c


示例10: gizmo_readl

static inline unsigned long gizmo_readl(unsigned long offset)
{
	return readl(IO_TO_VIRT(TEGRA_AHB_GIZMO_BASE + offset));
}
开发者ID:binkybear,项目名称:kangaroo,代码行数:4,代码来源:common.c


示例11: pg_readl

static inline unsigned long pg_readl(unsigned long offset)
{
	return readl(IO_TO_VIRT(TEGRA_APB_MISC_BASE + offset));
}
开发者ID:0x0f,项目名称:android-tegra-nv-2.6.39,代码行数:4,代码来源:pinmux-t3-tables.c


示例12: IO_TO_VIRT

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#include <xen/kernel.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <asm/fiqdb.h>
#include <asm/termbits.h>
#include <asm/serial_reg.h>
#include <asm/arch/hardware.h>

#define UART_SHIFT 2
static void __iomem *uart_base = (void __iomem *)
	IO_TO_VIRT(TEGRA_DEBUG_UART_BASE);

static inline unsigned char uart_read(int offset)
{
	return readb(uart_base + (offset << UART_SHIFT));
}

static inline void uart_write(unsigned char val, int offset)
{
	writeb(val, uart_base + (offset << UART_SHIFT));
}

static void tegra_fiqdb_flush(void)
{
	while (!(uart_read(UART_LSR) & UART_LSR_TEMT))
		cpu_relax();
开发者ID:andreiw,项目名称:xen3-arm-tegra,代码行数:31,代码来源:fiqdb_support.c


示例13: apb_readl

static inline u32 apb_readl(unsigned long offset)
{
    return readl(IO_TO_VIRT(offset));
}
开发者ID:jbaldus,项目名称:android_kernel_a100,代码行数:4,代码来源:apbio.c


示例14: clk_writel

#include <asm/io.h>
#include <asm/arch/hardware.h>

#define OSC_FREQ_DET			0x58
#define OSC_FREQ_DET_TRIG		(1<<31)

#define OSC_FREQ_DET_STATUS		0x5C
#define OSC_FREQ_DET_BUSY		(1<<31)
#define OSC_FREQ_DET_CNT_MASK		0xFFFF

#define clk_writel(value, reg) \
	__raw_writel(value, (u32)reg_clk_base + (reg))
#define clk_readl(reg) \
	__raw_readl((u32)reg_clk_base + (reg))

static void __iomem *reg_clk_base = (void __iomem *) IO_TO_VIRT(TEGRA_CLK_RESET_BASE);

unsigned long clk_measure_input_freq(void)
{
	u32 clock_autodetect;
	clk_writel(OSC_FREQ_DET_TRIG | 1, OSC_FREQ_DET);
	do {} while (clk_readl(OSC_FREQ_DET_STATUS) & OSC_FREQ_DET_BUSY);
	clock_autodetect = clk_readl(OSC_FREQ_DET_STATUS);
	if (clock_autodetect >= 732 - 3 && clock_autodetect <= 732 + 3) {
		return 12000000;
	} else if (clock_autodetect >= 794 - 3 && clock_autodetect <= 794 + 3) {
		return 13000000;
	} else if (clock_autodetect >= 1172 - 3 && clock_autodetect <= 1172 + 3) {
		return 19200000;
	} else if (clock_autodetect >= 1587 - 3 && clock_autodetect <= 1587 + 3) {
		return 26000000;
开发者ID:andreiw,项目名称:xen3-arm-tegra,代码行数:31,代码来源:tegra2_clocks.c



注:本文中的IO_TO_VIRT函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IOleClientSite_AddRef函数代码示例发布时间:2022-05-30
下一篇:
C++ IO_TAG函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap