资源简介
PD电源芯片fusb302的datasheet(数据手册)和rockchip原厂配套内核驱动程序。对开发PD电源有很大的帮助作用
代码片段和文件信息
/*
* Copyright (c) 2016 Fuzhou Rockchip Electronics Co. Ltd
* Author: Zain Wang
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* Some ideas are from chrome ec and fairchild GPL fusb302 driver.
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include “fusb302.h“
#define FUSB302_MAX_REG (FUSB_REG_FIFO + 50)
#define FUSB_MS_TO_NS(x) ((s64)x * 1000 * 1000)
#define TYPEC_CC_VOLT_OPEN 0
#define TYPEC_CC_VOLT_RA 1
#define TYPEC_CC_VOLT_RD 2
#define TYPEC_CC_VOLT_RP 3
#define EVENT_CC BIT(0)
#define EVENT_RX BIT(1)
#define EVENT_TX BIT(2)
#define EVENT_REC_RESET BIT(3)
#define EVENT_WORK_CONTINUE BIT(5)
#define EVENT_TIMER_MUX BIT(6)
#define EVENT_TIMER_STATE BIT(7)
#define EVENT_DELAY_CC BIT(8)
#define FLAG_EVENT (EVENT_RX | EVENT_TIMER_MUX | \
EVENT_TIMER_STATE)
#define PIN_MAP_A BIT(0)
#define PIN_MAP_B BIT(1)
#define PIN_MAP_C BIT(2)
#define PIN_MAP_D BIT(3)
#define PIN_MAP_E BIT(4)
#define PIN_MAP_F BIT(5)
#define PIN_MAP_MF_MASK 0x2a
#define PACKET_IS_CONTROL_MSG(header type) \
(PD_HEADER_CNT(header) == 0 && \
PD_HEADER_TYPE(header) == type)
#define PACKET_IS_DATA_MSG(header type) \
(PD_HEADER_CNT(header) != 0 && \
PD_HEADER_TYPE(header) == type)
#define VDM_DP_GET_RECEPTACLE(mode) ((mode >> 6) & 0x1)
#define VDM_DP_MULTIFUCTION(status) ((status >> 4) & 0x1)
static u8 fusb30x_port_used;
static struct fusb30x_chip *fusb30x_port_info[256];
static bool is_write_reg(struct device *dev unsigned int reg)
{
if (reg >= FUSB_REG_FIFO)
return true;
else
return ((reg < (FUSB_REG_CONTROL4 + 1)) && (reg > 0x01)) ?
true : false;
}
static bool is_volatile_reg(struct device *dev unsigned int reg)
{
if (reg > FUSB_REG_CONTROL4)
return true;
switch (reg) {
case FUSB_REG_CONTROL0:
case FUSB_REG_CONTROL1:
case FUSB_REG_CONTROL3:
case FUSB_REG_RESET:
return true;
}
return false;
}
struct regmap_config fusb302_regmap_config = {
.reg_bits = 8
.val_bits = 8
.writeable_reg = is_write_reg
.volatile_reg = is_volatile_reg
.max_register = FUSB302_MAX_REG
.cache_type = REGCACHE_RBTREE
};
static void dump_notify_info(struct fusb30x_chip *chip)
{
dev_dbg(chip->dev “port %d\n“ chip->port_num);
dev_dbg(chip->dev “orientation %d\n“ chip->notify.orientation);
dev_dbg(chip->dev “power_role %d\n“ chip->notify.power_role);
dev_dbg(chip->dev “data_role %d\n“ chip->notify.data_role);
dev_dbg(chip->dev “cc %d\n“ chip->notify.is_cc_connected);
dev_dbg(chip->dev “pd %d\n“ chip->notify.is_pd_connected);
dev_dbg(chip->dev “enter_mode %d\n“ chip->notify.is_enter_mode);
dev_dbg(chip->dev “pin support %d\
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-07-25 01:27 fusb302_data_and_code\
文件 13732 2019-07-25 01:27 fusb302_data_and_code\fusb302.h
文件 86891 2019-07-25 01:27 fusb302_data_and_code\fusb302.c
文件 297630 2019-07-25 01:27 fusb302_data_and_code\FUSB302BMPX 数据表.pdf
相关资源
- 银行业数据安全体系建设指南V1.0.pd
- OkHttpDemo.7z
- GIS面试题.PDF
- 工程数学课后答案全版.pdf
- 数学原理[罗素]清晰版
- war-ftpd 缓冲区溢出
-
Gba
se8tER复制技术白皮书_v1.0.pdf - DS18B20中文手册.pdf
- irun User Guide.pdf
- 没有银弹 Frederick P. Brooks Jr.
- SONY VISCA协议中文PDF
- ina226中文.pdf
- [网盘]OpenSceneGraph三维渲染引擎编程指
- 《DSP集成开发环境CCS开发指南》PDF版
- (超级高清版经典Verilog100多个经典代
- A11KDD2016-AsymmetricTransitivityPreservingGra
- activiti5.22 pdm模型
- 3GPP 25.321 HSDPA MAC协议中文版
- mmdetection-中文文档(自己翻译).pdf
- 操作系统真象还原.pdf 高清完整版
- 统计学习方法-李航pdf高清版百度网盘
- ActiveMQ中文文档.pdf
- ubuntu openssh 7.8p1 升级安装包
- Delphi XE3 with Update2 一键激活工具 Act
- LCD 1602 显示屏 数据手册 PDF 英文
- DynamicModelUpdate.rar
- 基于UML的网上购物系统的建模.pdf
- LPD6803的灰度演示程序
- 多个PDF文件整合成一个的PDF组合工具
- Differential Privacy From Theory to Practice.p
评论
共有 条评论