日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

全志 添加外挂RTC Hym8563

發布時間:2024/10/14 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 全志 添加外挂RTC Hym8563 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
add 添加外掛RTC hym8563diff --git a/lichee/linux-3.10/arch/arm/configs/sun8iw11p1smp_androidm_defconfig b/lichee/linux-3.10/arch/arm/configs/sun8iw11p1smp_androidm_defconfig index ae8b7ec..ad2e2c2 100755 --- a/lichee/linux-3.10/arch/arm/configs/sun8iw11p1smp_androidm_defconfig +++ b/lichee/linux-3.10/arch/arm/configs/sun8iw11p1smp_androidm_defconfig @@ -2801,7 +2801,7 @@ CONFIG_RTC_INTF_DEV=y# CONFIG_RTC_DRV_ISL12022 is not set# CONFIG_RTC_DRV_X1205 is not set# CONFIG_RTC_DRV_PCF8523 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 @@ -2847,7 +2847,7 @@ CONFIG_RTC_INTF_DEV=y## on-CPU RTC drivers# -CONFIG_RTC_DRV_SUNXI=y +#CONFIG_RTC_DRV_SUNXI=y# CONFIG_RTC_DRV_SNVS is not set# diff --git a/lichee/linux-3.10/drivers/rtc/rtc-pcf8563.c b/lichee/linux-3.10/drivers/rtc/rtc-pcf8563.c old mode 100644 new mode 100755 index 97b354a..b9f4a92 --- a/lichee/linux-3.10/drivers/rtc/rtc-pcf8563.c +++ b/lichee/linux-3.10/drivers/rtc/rtc-pcf8563.c @@ -20,287 +20,767 @@#include <linux/slab.h>#include <linux/module.h>#include <linux/of.h> +#include <linux/delay.h> +#include <linux/wakelock.h> +#include <linux/of_gpio.h> +#include <linux/irqdomain.h>#define DRV_VERSION "0.4.3"-#define PCF8563_REG_ST1 0x00 /* status */ -#define PCF8563_REG_ST2 0x01 +#define RTC_CTL1 0x00 +#define RTC_CTL2 0x01 +#define RTC_SEC 0x02 +#define RTC_MIN 0x03 +#define RTC_HOUR 0x04 +#define RTC_DAY 0x05 +#define RTC_WEEK 0x06 +#define RTC_MON 0x07 +#define RTC_YEAR 0x08 +#define RTC_A_MIN 0x09 +#define RTC_A_HOUR 0x0A +#define RTC_A_DAY 0x0B +#define RTC_A_WEEK 0x0C +#define RTC_CLKOUT 0x0D +#define RTC_T_CTL 0x0E +#define RTC_T_COUNT 0x0F +#define CENTURY 0x80 +#define TI 0x10 +#define AF 0x08 +#define TF 0x04 +#define AIE 0x02 +#define TIE 0x01 +#define FE 0x80 +#define TE 0x80 +#define FD1 0x02 +#define FD0 0x01 +#define TD1 0x02 +#define TD0 0x01 +#define VL 0x80 + +#define HYM8563_REG_LEN 0x10 +#define HYM8563_RTC_SECTION_LEN 0x07 +#define RTC_SPEED 200 * 1000 +unsigned int g_crtc_used = 0; +static unsigned char crtc_twi_id = 0; + +struct hym8563 { + int irq; + struct i2c_client *client; + struct mutex mutex; + struct rtc_device *rtc; + struct rtc_wkalrm alarm; + struct wake_lock wake_lock; +}; +static struct i2c_client *gClient = NULL;-#define PCF8563_REG_SC 0x02 /* datetime */ -#define PCF8563_REG_MN 0x03 -#define PCF8563_REG_HR 0x04 -#define PCF8563_REG_DM 0x05 -#define PCF8563_REG_DW 0x06 -#define PCF8563_REG_MO 0x07 -#define PCF8563_REG_YR 0x08 +static int i2c_master_reg8_send(const struct i2c_client *client, const char reg, const char *buf, int count, int scl_rate) +{ + struct i2c_adapter *adap=client->adapter; + struct i2c_msg msg; + int ret; + char *tx_buf = (char *)kzalloc(count + 1, GFP_KERNEL); + if(!tx_buf) + return -ENOMEM; + tx_buf[0] = reg; + memcpy(tx_buf+1, buf, count); -#define PCF8563_REG_AMN 0x09 /* alarm */ -#define PCF8563_REG_AHR 0x0A -#define PCF8563_REG_ADM 0x0B -#define PCF8563_REG_ADW 0x0C + msg.addr = client->addr; + msg.flags = client->flags; + msg.len = count + 1; + msg.buf = (char *)tx_buf; + //msg.scl_rate = scl_rate;-#define PCF8563_REG_CLKO 0x0D /* clock out */ -#define PCF8563_REG_TMRC 0x0E /* timer control */ -#define PCF8563_REG_TMR 0x0F /* timer */ + ret = i2c_transfer(adap, &msg, 1); + kfree(tx_buf); + return (ret == 1) ? count : ret;-#define PCF8563_SC_LV 0x80 /* low voltage */ -#define PCF8563_MO_C 0x80 /* century */ +} + +static int i2c_master_reg8_recv(const struct i2c_client *client, const char reg, char *buf, int count, int scl_rate) +{ + struct i2c_adapter *adap=client->adapter; + struct i2c_msg msgs[2]; + int ret; + char reg_buf = reg; + + msgs[0].addr = client->addr; + msgs[0].flags = client->flags; + msgs[0].len = 1; + msgs[0].buf = &reg_buf; + //msgs[0].scl_rate = scl_rate; + + msgs[1].addr = client->addr; + msgs[1].flags = client->flags | I2C_M_RD; + msgs[1].len = count; + msgs[1].buf = (char *)buf; + //msgs[1].scl_rate = scl_rate; + + ret = i2c_transfer(adap, msgs, 2); + + return (ret == 2)? count : ret; +}-static struct i2c_driver pcf8563_driver;-struct pcf8563 { - struct rtc_device *rtc; - /* - * The meaning of MO_C bit varies by the chip type. - * From PCF8563 datasheet: this bit is toggled when the years - * register overflows from 99 to 00 - * 0 indicates the century is 20xx - * 1 indicates the century is 19xx - * From RTC8564 datasheet: this bit indicates change of - * century. When the year digit data overflows from 99 to 00, - * this bit is set. By presetting it to 0 while still in the - * 20th century, it will be set in year 2000, ... - * There seems no reliable way to know how the system use this - * bit. So let's do it heuristically, assuming we are live in - * 1970...2069. - */ - int c_polarity; /* 0: MO_C=1 means 19xx, otherwise MO_C=1 means 20xx */ - int voltage_low; /* incicates if a low_voltage was detected */ -};-/* - * In the routines that deal directly with the pcf8563 hardware, we use - * rtc_time -- month 0-11, hour 0-23, yr = calendar year-epoch. - */ -static int pcf8563_get_datetime(struct i2c_client *client, struct rtc_time *tm) +static int hym8563_i2c_read_regs(struct i2c_client *client, u8 reg, u8 buf[], unsigned len) +{ + int ret; + ret = i2c_master_reg8_recv(client, reg, buf, len, RTC_SPEED); + return ret; +} + +static int hym8563_i2c_set_regs(struct i2c_client *client, u8 reg, u8 const buf[], __u16 len){ - struct pcf8563 *pcf8563 = i2c_get_clientdata(client); - unsigned char buf[13] = { PCF8563_REG_ST1 }; - - struct i2c_msg msgs[] = { - {/* setup read ptr */ - .addr = client->addr, - .len = 1, - .buf = buf - }, - {/* read status + date */ - .addr = client->addr, - .flags = I2C_M_RD, - .len = 13, - .buf = buf - }, - }; - - /* read registers */ - if ((i2c_transfer(client->adapter, msgs, 2)) != 2) { - dev_err(&client->dev, "%s: read error\n", __func__); - return -EIO; + int ret; + ret = i2c_master_reg8_send(client, reg, buf, (int)len, RTC_SPEED); + return ret; +} + + +int hym8563_enable_count(struct i2c_client *client, int en) +{ + struct hym8563 *hym8563 = i2c_get_clientdata(client); + u8 regs[2]; + + if (!hym8563) + return -1; + + if (en) { + hym8563_i2c_read_regs(client, RTC_CTL2, regs, 1); + regs[0] |= TIE; + hym8563_i2c_set_regs(client, RTC_CTL2, regs, 1); + regs[0] = 0; + regs[0] |= (TE | TD1); + hym8563_i2c_set_regs(client, RTC_T_CTL, regs, 1); + } + else { + hym8563_i2c_read_regs(client, RTC_CTL2, regs, 1); + regs[0] &= ~TIE; + hym8563_i2c_set_regs(client, RTC_CTL2, regs, 1); + regs[0] = 0; + regs[0] |= (TD0 | TD1); + hym8563_i2c_set_regs(client, RTC_T_CTL, regs, 1);} + return 0; +} + +//0 < sec <=255 +int hym8563_set_count(struct i2c_client *client, int sec) +{ + struct hym8563 *hym8563 = i2c_get_clientdata(client); + u8 regs[2]; + + if (!hym8563) + return -1; + + if (sec >= 255) + regs[0] = 255; + else if (sec <= 1) + regs[0] = 1; + else + regs[0] = sec; + + hym8563_i2c_set_regs(client, RTC_T_COUNT, regs, 1); + + return 0; +}- if (buf[PCF8563_REG_SC] & PCF8563_SC_LV) { - pcf8563->voltage_low = 1; - dev_info(&client->dev, - "low voltage detected, date/time is not reliable.\n"); + +/*the init of the hym8563 at first time */ +static int hym8563_init_device(struct i2c_client *client) +{ + struct hym8563 *hym8563 = i2c_get_clientdata(client); + u8 regs[2]; + int sr; + + mutex_lock(&hym8563->mutex); + regs[0]=0; + sr = hym8563_i2c_set_regs(client, RTC_CTL1, regs, 1); + if (sr < 0) + goto exit; + + //disable clkout + regs[0] = 0x80; + sr = hym8563_i2c_set_regs(client, RTC_CLKOUT, regs, 1); + if (sr < 0) + goto exit; + + /*enable alarm && count interrupt*/ + sr = hym8563_i2c_read_regs(client, RTC_CTL2, regs, 1); + if (sr < 0) + goto exit; + regs[0] = 0x0; + regs[0] |= (AIE | TIE); + sr = hym8563_i2c_set_regs(client, RTC_CTL2, regs, 1); + if (sr < 0) + goto exit; + sr = hym8563_i2c_read_regs(client, RTC_CTL2, regs, 1); + if (sr < 0) + goto exit; + + sr = hym8563_i2c_read_regs(client, RTC_CTL2, regs, 1); + if (sr < 0) { + pr_err("read CTL2 err\n"); + goto exit; + } + + if(regs[0] & (AF|TF)) + { + regs[0] &= ~(AF|TF); + sr = hym8563_i2c_set_regs(client, RTC_CTL2, regs, 1);} + +exit: + mutex_unlock(&hym8563->mutex); + + return sr; +} + +static int hym8563_read_datetime(struct i2c_client *client, struct rtc_time *tm) +{ + struct hym8563 *hym8563 = i2c_get_clientdata(client); + u8 regs[HYM8563_RTC_SECTION_LEN] = { 0, }; + mutex_lock(&hym8563->mutex); +// for (i = 0; i < HYM8563_RTC_SECTION_LEN; i++) { +// hym8563_i2c_read_regs(client, RTC_SEC+i, &regs[i], 1); +// } + hym8563_i2c_read_regs(client, RTC_SEC, regs, HYM8563_RTC_SECTION_LEN); + + mutex_unlock(&hym8563->mutex); + + tm->tm_sec = bcd2bin(regs[0x00] & 0x7F); + tm->tm_min = bcd2bin(regs[0x01] & 0x7F); + tm->tm_hour = bcd2bin(regs[0x02] & 0x3F); + tm->tm_mday = bcd2bin(regs[0x03] & 0x3F); + tm->tm_wday = bcd2bin(regs[0x04] & 0x07); + + tm->tm_mon = bcd2bin(regs[0x05] & 0x1F) ; + tm->tm_mon -= 1; //inorder to cooperate the systerm time + + tm->tm_year = bcd2bin(regs[0x06] & 0xFF); + if(regs[5] & 0x80) + tm->tm_year += 1900; + else + tm->tm_year += 2000; + + tm->tm_year -= 1900; //inorder to cooperate the systerm time + if(tm->tm_year < 0) + tm->tm_year = 0; + tm->tm_isdst = 0; + + printk("%4d-%02d-%02d(%d) %02d:%02d:%02d\n", + 1900 + tm->tm_year, tm->tm_mon + 1, tm->tm_mday, tm->tm_wday, + tm->tm_hour, tm->tm_min, tm->tm_sec); + + return 0; +} + +static int hym8563_rtc_read_time(struct device *dev, struct rtc_time *tm) +{ + return hym8563_read_datetime(to_i2c_client(dev), tm); +}- dev_dbg(&client->dev, - "%s: raw data is st1=%02x, st2=%02x, sec=%02x, min=%02x, hr=%02x, " - "mday=%02x, wday=%02x, mon=%02x, year=%02x\n", - __func__, - buf[0], buf[1], buf[2], buf[3], - buf[4], buf[5], buf[6], buf[7], - buf[8]); - - - tm->tm_sec = bcd2bin(buf[PCF8563_REG_SC] & 0x7F); - tm->tm_min = bcd2bin(buf[PCF8563_REG_MN] & 0x7F); - tm->tm_hour = bcd2bin(buf[PCF8563_REG_HR] & 0x3F); /* rtc hr 0-23 */ - tm->tm_mday = bcd2bin(buf[PCF8563_REG_DM] & 0x3F); - tm->tm_wday = buf[PCF8563_REG_DW] & 0x07; - tm->tm_mon = bcd2bin(buf[PCF8563_REG_MO] & 0x1F) - 1; /* rtc mn 1-12 */ - tm->tm_year = bcd2bin(buf[PCF8563_REG_YR]); - if (tm->tm_year < 70) - tm->tm_year += 100; /* assume we are in 1970...2069 */ - /* detect the polarity heuristically. see note above. */ - pcf8563->c_polarity = (buf[PCF8563_REG_MO] & PCF8563_MO_C) ? - (tm->tm_year >= 100) : (tm->tm_year < 100); - - dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d, " - "mday=%d, mon=%d, year=%d, wday=%d\n", - __func__, - tm->tm_sec, tm->tm_min, tm->tm_hour, - tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); - - /* the clock can give out invalid datetime, but we cannot return - * -EINVAL otherwise hwclock will refuse to set the time on bootup. - */ - if (rtc_valid_tm(tm) < 0) - dev_err(&client->dev, "retrieved date/time is not valid.\n"); +static int hym8563_set_time(struct i2c_client *client, struct rtc_time *tm) +{ + struct hym8563 *hym8563 = i2c_get_clientdata(client); + u8 regs[HYM8563_RTC_SECTION_LEN] = { 0, }; + u8 mon_day; + //u8 ret = 0; + + printk("%4d-%02d-%02d(%d) %02d:%02d:%02d\n", + 1900 + tm->tm_year, tm->tm_mon + 1, tm->tm_mday, tm->tm_wday, + tm->tm_hour, tm->tm_min, tm->tm_sec); + + mon_day = rtc_month_days((tm->tm_mon), tm->tm_year + 1900); + + if(tm->tm_sec >= 60 || tm->tm_sec < 0 ) //set sec + regs[0x00] = bin2bcd(0x00); + else + regs[0x00] = bin2bcd(tm->tm_sec); + + if(tm->tm_min >= 60 || tm->tm_min < 0 ) //set min + regs[0x01] = bin2bcd(0x00); + else + regs[0x01] = bin2bcd(tm->tm_min); + + if(tm->tm_hour >= 24 || tm->tm_hour < 0 ) //set hour + regs[0x02] = bin2bcd(0x00); + else + regs[0x02] = bin2bcd(tm->tm_hour); + + if((tm->tm_mday) > mon_day) //if the input month day is bigger than the biggest day of this month, set the biggest day + regs[0x03] = bin2bcd(mon_day); + else if((tm->tm_mday) > 0) + regs[0x03] = bin2bcd(tm->tm_mday); + else if((tm->tm_mday) <= 0) + regs[0x03] = bin2bcd(0x01); + + if( tm->tm_year >= 200) // year >= 2100 + regs[0x06] = bin2bcd(99); //year = 2099 + else if(tm->tm_year >= 100) // 2000 <= year < 2100 + regs[0x06] = bin2bcd(tm->tm_year - 100); + else if(tm->tm_year >= 0){ // 1900 <= year < 2000 + regs[0x06] = bin2bcd(tm->tm_year); + regs[0x05] |= 0x80; + }else{ // year < 1900 + regs[0x06] = bin2bcd(0); //year = 1900 + regs[0x05] |= 0x80; + } + regs[0x04] = bin2bcd(tm->tm_wday); //set the weekday + regs[0x05] = (regs[0x05] & 0x80)| (bin2bcd(tm->tm_mon + 1) & 0x7F); //set the month + + mutex_lock(&hym8563->mutex); +// for(i=0;i<HYM8563_RTC_SECTION_LEN;i++){ +// ret = hym8563_i2c_set_regs(client, RTC_SEC+i, &regs[i], 1); +// } + hym8563_i2c_set_regs(client, RTC_SEC, regs, HYM8563_RTC_SECTION_LEN); + + mutex_unlock(&hym8563->mutex);return 0;}-static int pcf8563_set_datetime(struct i2c_client *client, struct rtc_time *tm) +static int hym8563_rtc_set_time(struct device *dev, struct rtc_time *tm){ - struct pcf8563 *pcf8563 = i2c_get_clientdata(client); - int i, err; - unsigned char buf[9]; - - dev_dbg(&client->dev, "%s: secs=%d, mins=%d, hours=%d, " - "mday=%d, mon=%d, year=%d, wday=%d\n", - __func__, - tm->tm_sec, tm->tm_min, tm->tm_hour, - tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); - - /* hours, minutes and seconds */ - buf[PCF8563_REG_SC] = bin2bcd(tm->tm_sec); - buf[PCF8563_REG_MN] = bin2bcd(tm->tm_min); - buf[PCF8563_REG_HR] = bin2bcd(tm->tm_hour); - - buf[PCF8563_REG_DM] = bin2bcd(tm->tm_mday); - - /* month, 1 - 12 */ - buf[PCF8563_REG_MO] = bin2bcd(tm->tm_mon + 1); - - /* year and century */ - buf[PCF8563_REG_YR] = bin2bcd(tm->tm_year % 100); - if (pcf8563->c_polarity ? (tm->tm_year >= 100) : (tm->tm_year < 100)) - buf[PCF8563_REG_MO] |= PCF8563_MO_C; - - buf[PCF8563_REG_DW] = tm->tm_wday & 0x07; - - /* write register's data */ - for (i = 0; i < 7; i++) { - unsigned char data[2] = { PCF8563_REG_SC + i, - buf[PCF8563_REG_SC + i] }; - - err = i2c_master_send(client, data, sizeof(data)); - if (err != sizeof(data)) { - dev_err(&client->dev, - "%s: err=%d addr=%02x, data=%02x\n", - __func__, err, data[0], data[1]); - return -EIO; + return hym8563_set_time(to_i2c_client(dev), tm); +} + +static int hym8563_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *tm) +{ + struct i2c_client *client = to_i2c_client(dev); + struct hym8563 *hym8563 = i2c_get_clientdata(client); + u8 regs[4] = { 0, }; + + printk("enter\n"); + mutex_lock(&hym8563->mutex); + hym8563_i2c_read_regs(client, RTC_A_MIN, regs, 4); + regs[0] = 0x0; + regs[0] |= TIE; + hym8563_i2c_set_regs(client, RTC_CTL2, regs, 1); + mutex_unlock(&hym8563->mutex); + return 0; +} + +static int hym8563_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) +{ + struct i2c_client *client = to_i2c_client(dev); + struct hym8563 *hym8563 = i2c_get_clientdata(client); + struct rtc_time now, *tm = &alarm->time; + u8 regs[4] = { 0, }; + u8 mon_day; + unsigned long alarm_sec, now_sec; + int diff_sec = 0; + + printk("%4d-%02d-%02d(%d) %02d:%02d:%02d enabled %d\n", + 1900 + tm->tm_year, tm->tm_mon + 1, tm->tm_mday, tm->tm_wday, + tm->tm_hour, tm->tm_min, tm->tm_sec, alarm->enabled); + + + hym8563_read_datetime(client, &now); + + + mutex_lock(&hym8563->mutex); + rtc_tm_to_time(tm, &alarm_sec); + rtc_tm_to_time(&now, &now_sec); + + diff_sec = alarm_sec - now_sec; + + if((diff_sec > 0) && (diff_sec < 256)) + { + printk("%s:diff_sec= %ds , use time\n",__func__, diff_sec); + + if (alarm->enabled == 1) + { + hym8563_set_count(client, diff_sec); + hym8563_enable_count(client, 1);} + + else + { + hym8563_enable_count(client, 0); + } + + } + else + { + printk("%s:diff_sec= %ds , use alarm\n",__func__, diff_sec); + hym8563_enable_count(client, 0); + + if(tm->tm_sec > 0) + { + rtc_tm_to_time(tm, &alarm_sec); + rtc_time_to_tm(alarm_sec, tm); + } + + hym8563->alarm = *alarm; + + regs[0] = 0x0; + hym8563_i2c_set_regs(client, RTC_CTL2, regs, 1); + mon_day = rtc_month_days(tm->tm_mon, tm->tm_year + 1900); + hym8563_i2c_read_regs(client, RTC_A_MIN, regs, 4); + + if (tm->tm_min >= 60 || tm->tm_min < 0) //set min + regs[0x00] = bin2bcd(0x00) & 0x7f; + else + regs[0x00] = bin2bcd(tm->tm_min) & 0x7f; + if (tm->tm_hour >= 24 || tm->tm_hour < 0) //set hour + regs[0x01] = bin2bcd(0x00) & 0x7f; + else + regs[0x01] = bin2bcd(tm->tm_hour) & 0x7f; + regs[0x03] = bin2bcd (tm->tm_wday) & 0x7f; + + /* if the input month day is bigger than the biggest day of this month, set the biggest day */ + if (tm->tm_mday > mon_day) + regs[0x02] = bin2bcd(mon_day) & 0x7f; + else if (tm->tm_mday > 0) + regs[0x02] = bin2bcd(tm->tm_mday) & 0x7f; + else if (tm->tm_mday <= 0) + regs[0x02] = bin2bcd(0x01) & 0x7f; + + hym8563_i2c_set_regs(client, RTC_A_MIN, regs, 4); + hym8563_i2c_read_regs(client, RTC_A_MIN, regs, 4); + hym8563_i2c_read_regs(client, RTC_CTL2, regs, 1); + if (alarm->enabled == 1) + regs[0] |= AIE; + else + regs[0] &= 0x0; + hym8563_i2c_set_regs(client, RTC_CTL2, regs, 1); + hym8563_i2c_read_regs(client, RTC_CTL2, regs, 1); + + if(diff_sec <= 0) + { + pr_info("alarm sec <= now sec\n"); + } +} + + mutex_unlock(&hym8563->mutex);return 0;}-#ifdef CONFIG_RTC_INTF_DEV -static int pcf8563_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg) +#if defined(CONFIG_RTC_INTF_DEV) || defined(CONFIG_RTC_INTF_DEV_MODULE) +static int hym8563_i2c_open_alarm(struct i2c_client *client){ - struct pcf8563 *pcf8563 = i2c_get_clientdata(to_i2c_client(dev)); - struct rtc_time tm; + u8 data; + hym8563_i2c_read_regs(client, RTC_CTL2, &data, 1); + data |= AIE; + hym8563_i2c_set_regs(client, RTC_CTL2, &data, 1);- switch (cmd) { - case RTC_VL_READ: - if (pcf8563->voltage_low) - dev_info(dev, "low voltage detected, date/time is not reliable.\n"); + return 0; +}- if (copy_to_user((void __user *)arg, &pcf8563->voltage_low, - sizeof(int))) - return -EFAULT; - return 0; - case RTC_VL_CLR: - /* - * Clear the VL bit in the seconds register in case - * the time has not been set already (which would - * have cleared it). This does not really matter - * because of the cached voltage_low value but do it - * anyway for consistency. - */ - if (pcf8563_get_datetime(to_i2c_client(dev), &tm)) - pcf8563_set_datetime(to_i2c_client(dev), &tm); - - /* Clear the cached value. */ - pcf8563->voltage_low = 0; +static int hym8563_i2c_close_alarm(struct i2c_client *client) +{ + u8 data; + hym8563_i2c_read_regs(client, RTC_CTL2, &data, 1); + data &= ~AIE; + hym8563_i2c_set_regs(client, RTC_CTL2, &data, 1);- return 0; + return 0; +} + +static int hym8563_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg) +{ + struct i2c_client *client = to_i2c_client(dev); + + switch (cmd) { + case RTC_AIE_OFF: + if(hym8563_i2c_close_alarm(client) < 0) + goto err; + break; + case RTC_AIE_ON: + if(hym8563_i2c_open_alarm(client)) + goto err; + break;default:return -ENOIOCTLCMD; - } + } + return 0; +err: + return -EIO;}#else -#define pcf8563_rtc_ioctl NULL +#define hym8563_rtc_ioctl NULL#endif-static int pcf8563_rtc_read_time(struct device *dev, struct rtc_time *tm) +#if defined(CONFIG_RTC_INTF_PROC) || defined(CONFIG_RTC_INTF_PROC_MODULE) +static int hym8563_rtc_proc(struct device *dev, struct seq_file *seq){ - return pcf8563_get_datetime(to_i2c_client(dev), tm); + return 0;} +#else +#define hym8563_rtc_proc NULL +#endif-static int pcf8563_rtc_set_time(struct device *dev, struct rtc_time *tm) +static irqreturn_t hym8563_wakeup_irq(int irq, void *data){ - return pcf8563_set_datetime(to_i2c_client(dev), tm); + struct hym8563 *hym8563 = data; + struct i2c_client *client = hym8563->client; + u8 value; + + mutex_lock(&hym8563->mutex); + hym8563_i2c_read_regs(client, RTC_CTL2, &value, 1); + value &= ~(AF|TF); + hym8563_i2c_set_regs(client, RTC_CTL2, &value, 1); + mutex_unlock(&hym8563->mutex); + + rtc_update_irq(hym8563->rtc, 1, RTC_IRQF | RTC_AF | RTC_UF); + + //printk("%s:irq=%d\n",__func__,irq); + return IRQ_HANDLED;}-static const struct rtc_class_ops pcf8563_rtc_ops = { - .ioctl = pcf8563_rtc_ioctl, - .read_time = pcf8563_rtc_read_time, - .set_time = pcf8563_rtc_set_time, +static const struct rtc_class_ops hym8563_rtc_ops = { + .read_time = hym8563_rtc_read_time, + .set_time = hym8563_rtc_set_time, + .read_alarm = hym8563_rtc_read_alarm, + .set_alarm = hym8563_rtc_set_alarm, + .ioctl = hym8563_rtc_ioctl, + .proc = hym8563_rtc_proc};-static int pcf8563_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int hym8563_probe(struct i2c_client *client, const struct i2c_device_id *id){ - struct pcf8563 *pcf8563; - - dev_dbg(&client->dev, "%s\n", __func__); - + int rc = 0; + u8 reg = 0; + struct hym8563 *hym8563; + struct rtc_device *rtc = NULL; + struct rtc_time tm_read, tm = { + .tm_wday = 6, + .tm_year = 111, + .tm_mon = 0, + .tm_mday = 1, + .tm_hour = 12, + .tm_min = 0, + .tm_sec = 0, + }; + + struct device_node *np = of_find_node_by_name(NULL,"crtc"); + unsigned long irq_flags = 0; + int result; + printk("hym8563_probe\n");if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))return -ENODEV; - - pcf8563 = devm_kzalloc(&client->dev, sizeof(struct pcf8563), - GFP_KERNEL); - if (!pcf8563) + + hym8563 = devm_kzalloc(&client->dev,sizeof(*hym8563), GFP_KERNEL); + if (!hym8563) {return -ENOMEM; + }- dev_info(&client->dev, "chip found, driver version " DRV_VERSION "\n"); + gClient = client; + hym8563->client = client; + hym8563->alarm.enabled = 0; + client->irq = 0; + mutex_init(&hym8563->mutex); + wake_lock_init(&hym8563->wake_lock, WAKE_LOCK_SUSPEND, "rtc_hym8563"); + i2c_set_clientdata(client, hym8563); + + hym8563_init_device(client); + hym8563_enable_count(client, 0); + + // check power down + printk("hym8563_probe 11\n"); + hym8563_i2c_read_regs(client,RTC_SEC,&reg,1); + if (reg&0x80) { + dev_info(&client->dev, "clock/calendar information is no longer guaranteed\n"); + hym8563_set_time(client, &tm); + } +printk("hym8563_probe reg=0x%x\n",reg); + hym8563_read_datetime(client, &tm_read); //read time from hym8563 + + if(((tm_read.tm_year < 70) | (tm_read.tm_year > 137 )) | (tm_read.tm_mon == -1) | (rtc_valid_tm(&tm_read) != 0)) //if the hym8563 haven't initialized + { + hym8563_set_time(client, &tm); //initialize the hym8563 + } + if(!np){ + printk("rtc hym8563_probe can't get irq gpio\n"); + }else { + printk("rtc hym8563_probe get irq gpio\n"); + client->irq = of_get_named_gpio_flags(np, "crtc_irq_gpio", 0,(enum of_gpio_flags *)&irq_flags); + if(client->irq >= 0) + { + printk("rtc hym8563_probe get irq\n"); + hym8563->irq = gpio_to_irq(client->irq); + //result = devm_request_irq(&client->dev, hym8563->irq, hym8563_wakeup_irq, + // irq_flags | IRQF_ONESHOT, client->dev.driver->name, hym8563); + result = devm_request_threaded_irq(&client->dev, hym8563->irq, NULL, hym8563_wakeup_irq, irq_flags | IRQF_ONESHOT, client->dev.driver->name,hym8563 ); + if (result) { + printk( "%s:fail rtc to request irq = %d, ret = 0x%x\n",__func__, hym8563->irq, result); + goto exit; + } + enable_irq_wake(hym8563->irq); + device_init_wakeup(&client->dev, 1); + } + } + //device_init_wakeup(&client->dev, 1); + rtc = devm_rtc_device_register(&client->dev, + client->name, + &hym8563_rtc_ops, THIS_MODULE); + if (IS_ERR(rtc)) { + rc = PTR_ERR(rtc); + rtc = NULL; + goto exit; + } + hym8563->rtc = rtc; +printk("hym8563_probe ok\n"); + return 0;- i2c_set_clientdata(client, pcf8563); +exit: + if (hym8563) { + wake_lock_destroy(&hym8563->wake_lock); + } + return rc; +}- pcf8563->rtc = devm_rtc_device_register(&client->dev, - pcf8563_driver.driver.name, - &pcf8563_rtc_ops, THIS_MODULE); +static int hym8563_remove(struct i2c_client *client) +{ + struct hym8563 *hym8563 = i2c_get_clientdata(client);- if (IS_ERR(pcf8563->rtc)) - return PTR_ERR(pcf8563->rtc); + wake_lock_destroy(&hym8563->wake_lock);return 0;}-static int pcf8563_remove(struct i2c_client *client) + +void hym8563_shutdown(struct i2c_client * client) +{ u8 regs[2]; + int ret; + //disable clkout + regs[0] = 0x00; + ret=hym8563_i2c_set_regs(client, RTC_CLKOUT, regs, 1); + if(ret<0) + printk("rtc shutdown is error\n"); +} + +static int pcf8563_detect(struct i2c_client *new_client, struct i2c_board_info *info){ - return 0; + struct i2c_adapter *adapter = new_client->adapter; + + printk(" richard rtc pcf8563_detect: %s:bus[%d] addr[0x%x]\n", __func__, adapter->nr, new_client->addr); + + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) + return -ENODEV; + + if (crtc_twi_id == adapter->nr) { + printk("rtc pcf8563_detect crtc_twi_id=%d\n",crtc_twi_id); + strlcpy(info->type, "rtc_hym8563", I2C_NAME_SIZE); + return 0; + } + + return -ENODEV;}-static const struct i2c_device_id pcf8563_id[] = { - { "pcf8563", 0 }, - { "rtc8564", 0 }, + +static const struct i2c_device_id hym8563_id[] = { + { "rtc_hym8563", 0 },{ }}; -MODULE_DEVICE_TABLE(i2c, pcf8563_id); +MODULE_DEVICE_TABLE(i2c, hym8563_id);-#ifdef CONFIG_OF -static const struct of_device_id pcf8563_of_match[] = { - { .compatible = "nxp,pcf8563" }, - {} +static struct of_device_id rtc_dt_ids[] = { + { .compatible = "rtc,hym8563" }, + {},}; -MODULE_DEVICE_TABLE(of, pcf8563_of_match); -#endif-static struct i2c_driver pcf8563_driver = { +static const unsigned short normal_i2c[] = { 0x51, I2C_CLIENT_END }; +struct i2c_driver hym8563_driver = { + .class = I2C_CLASS_HWMON | I2C_CLASS_SPD,.driver = { - .name = "rtc-pcf8563", + .name = "rtc_hym8563",.owner = THIS_MODULE, - .of_match_table = of_match_ptr(pcf8563_of_match), + .of_match_table = of_match_ptr(rtc_dt_ids),}, - .probe = pcf8563_probe, - .remove = pcf8563_remove, - .id_table = pcf8563_id, + .probe = hym8563_probe, + .remove = hym8563_remove, + .detect = pcf8563_detect, + //.shutdown=hym8563_shutdown, + .id_table = hym8563_id, + .address_list = normal_i2c,};-module_i2c_driver(pcf8563_driver); + + +static int crtc_fetch_sysconfig_para() +{ + int ret = -1; + + + struct device_node *np = NULL; + np = of_find_node_by_name(NULL,"crtc"); + if (!np) { + printk("ERROR! get crtc failed, func:%s, line:%d\n",__FUNCTION__, __LINE__); + goto devicetree_get_item_err; + } +printk("crtc crtc_fetch_sysconfig_para\n"); + if (!of_device_is_available(np)) { + printk("%s: crtc is not used\n", __func__); + goto devicetree_get_item_err; + }else { + g_crtc_used = 1; + } +printk("crtc crtc_fetch_sysconfig_para crtc_used=%d\n",g_crtc_used); + if(1 == g_crtc_used){ + ret = of_property_read_u32(np, "crtc_twi_id", &crtc_twi_id); + if (ret) { + pr_err("get crtc_twi_id is fail, %d\n", ret); + goto devicetree_get_item_err; + } + + }else{ + pr_err("%s crtc_unused \n",__func__); + } +printk("crtc crtc_fetch_sysconfig_para 2\n"); + return ret; + +devicetree_get_item_err: +printk("crtc crtc_fetch_sysconfig_para 3\n"); + ret = -1; + return ret; + +} + +static int __init rtc_pcf8563_init(void) +{ + int ret; + + + if (crtc_fetch_sysconfig_para()) { + printk("fetch_crtc_sysconfig_para failed!\n"); + return -1; + } + printk("step4 : rtc_pcf8563_init crtc_used=%d,crtc_twi_id=%d\n",g_crtc_used,crtc_twi_id); + + if (g_crtc_used == 0) { + printk("*** crtc_used set to 0 !\n"); + return -1; + } +//gadap = i2c_get_adapter(crtc_twi_id); + ret = i2c_add_driver(&hym8563_driver); + if (ret < 0) { + printk("add pcf8563 i2c driver failed\n"); + return -ENODEV; + } + /*ret = i2c_register_board_info(crtc_twi_id, pcf8563_i2c_board_info, ARRAY_SIZE(pcf8563_i2c_board_info)); + if (ret < 0) { + printk("rtc_i2c_board_info add failed\n"); + return ret; + } +*/ +printk("step4 : rtc_pcf8563_init ok\n"); + return (ret); +} + +/*----------------------------------------------------------------------------*/ +static void __exit rtc_pcf8563_exit(void) +{ + + i2c_del_driver(&hym8563_driver); +} + +module_init(rtc_pcf8563_init); +module_exit(rtc_pcf8563_exit); +//module_i2c_driver(pcf8563_driver);MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>");MODULE_DESCRIPTION("Philips PCF8563/Epson RTC8564 RTC driver"); diff --git a/lichee/linux-3.10/drivers/rtc/rtc-pcf8563123.c b/lichee/linux-3.10/drivers/rtc/rtc-pcf8563123.c new file mode 100755 index 0000000..e22f7bf --- /dev/null +++ b/lichee/linux-3.10/drivers/rtc/rtc-pcf8563123.c @@ -0,0 +1,415 @@ +/* + * An I2C driver for the Philips PCF8563 RTC + * Copyright 2005-06 Tower Technologies + * + * Author: Alessandro Zummo <a.zummo@towertech.it> + * Maintainers: http://www.nslu2-linux.org/ + * + * based on the other drivers in this same directory. + * + * http://www.semiconductors.philips.com/acrobat/datasheets/PCF8563-04.pdf + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include <linux/i2c.h> +#include <linux/bcd.h> +#include <linux/rtc.h> +#include <linux/slab.h> +#include <linux/module.h> +#include <linux/of.h> + +#define DRV_VERSION "0.4.3" + +#define PCF8563_REG_ST1 0x00 /* status */ +#define PCF8563_REG_ST2 0x01 + +#define PCF8563_REG_SC 0x02 /* datetime */ +#define PCF8563_REG_MN 0x03 +#define PCF8563_REG_HR 0x04 +#define PCF8563_REG_DM 0x05 +#define PCF8563_REG_DW 0x06 +#define PCF8563_REG_MO 0x07 +#define PCF8563_REG_YR 0x08 + +#define PCF8563_REG_AMN 0x09 /* alarm */ +#define PCF8563_REG_AHR 0x0A +#define PCF8563_REG_ADM 0x0B +#define PCF8563_REG_ADW 0x0C + +#define PCF8563_REG_CLKO 0x0D /* clock out */ +#define PCF8563_REG_TMRC 0x0E /* timer control */ +#define PCF8563_REG_TMR 0x0F /* timer */ + +#define PCF8563_SC_LV 0x80 /* low voltage */ +#define PCF8563_MO_C 0x80 /* century */ + +static struct i2c_driver pcf8563_driver; +struct i2c_adapter *gadap; +static unsigned char crtc_twi_id = 0; +unsigned int g_crtc_used = 0; +struct pcf8563 { + struct rtc_device *rtc; + /* + * The meaning of MO_C bit varies by the chip type. + * From PCF8563 datasheet: this bit is toggled when the years + * register overflows from 99 to 00 + * 0 indicates the century is 20xx + * 1 indicates the century is 19xx + * From RTC8564 datasheet: this bit indicates change of + * century. When the year digit data overflows from 99 to 00, + * this bit is set. By presetting it to 0 while still in the + * 20th century, it will be set in year 2000, ... + * There seems no reliable way to know how the system use this + * bit. So let's do it heuristically, assuming we are live in + * 1970...2069. + */ + int c_polarity; /* 0: MO_C=1 means 19xx, otherwise MO_C=1 means 20xx */ + int voltage_low; /* incicates if a low_voltage was detected */ +}; + +/* + * In the routines that deal directly with the pcf8563 hardware, we use + * rtc_time -- month 0-11, hour 0-23, yr = calendar year-epoch. + */ +static int pcf8563_get_datetime(struct i2c_client *client, struct rtc_time *tm) +{ + struct pcf8563 *pcf8563 = i2c_get_clientdata(client); + unsigned char buf[13] = { PCF8563_REG_ST1 }; + + struct i2c_msg msgs[] = { + {/* setup read ptr */ + .addr = client->addr, + .len = 1, + .buf = buf + }, + {/* read status + date */ + .addr = client->addr, + .flags = I2C_M_RD, + .len = 13, + .buf = buf + }, + }; + + /* read registers */ + if ((i2c_transfer(client->adapter, msgs, 2)) != 2) { + dev_err(&client->dev, "%s: read error\n", __func__); + return -EIO; + } + + if (buf[PCF8563_REG_SC] & PCF8563_SC_LV) { + pcf8563->voltage_low = 1; + dev_info(&client->dev, + "low voltage detected, date/time is not reliable.\n"); + } + + dev_dbg(&client->dev, + "%s: raw data is st1=%02x, st2=%02x, sec=%02x, min=%02x, hr=%02x, " + "mday=%02x, wday=%02x, mon=%02x, year=%02x\n", + __func__, + buf[0], buf[1], buf[2], buf[3], + buf[4], buf[5], buf[6], buf[7], + buf[8]); + + + tm->tm_sec = bcd2bin(buf[PCF8563_REG_SC] & 0x7F); + tm->tm_min = bcd2bin(buf[PCF8563_REG_MN] & 0x7F); + tm->tm_hour = bcd2bin(buf[PCF8563_REG_HR] & 0x3F); /* rtc hr 0-23 */ + tm->tm_mday = bcd2bin(buf[PCF8563_REG_DM] & 0x3F); + tm->tm_wday = buf[PCF8563_REG_DW] & 0x07; + tm->tm_mon = bcd2bin(buf[PCF8563_REG_MO] & 0x1F) - 1; /* rtc mn 1-12 */ + tm->tm_year = bcd2bin(buf[PCF8563_REG_YR]); + if (tm->tm_year < 70) + tm->tm_year += 100; /* assume we are in 1970...2069 */ + /* detect the polarity heuristically. see note above. */ + pcf8563->c_polarity = (buf[PCF8563_REG_MO] & PCF8563_MO_C) ? + (tm->tm_year >= 100) : (tm->tm_year < 100); + + dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d, " + "mday=%d, mon=%d, year=%d, wday=%d\n", + __func__, + tm->tm_sec, tm->tm_min, tm->tm_hour, + tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); + + /* the clock can give out invalid datetime, but we cannot return + * -EINVAL otherwise hwclock will refuse to set the time on bootup. + */ + if (rtc_valid_tm(tm) < 0) + dev_err(&client->dev, "retrieved date/time is not valid.\n"); + + return 0; +} + +static int pcf8563_set_datetime(struct i2c_client *client, struct rtc_time *tm) +{ + struct pcf8563 *pcf8563 = i2c_get_clientdata(client); + int i, err; + unsigned char buf[9]; + + dev_dbg(&client->dev, "%s: secs=%d, mins=%d, hours=%d, " + "mday=%d, mon=%d, year=%d, wday=%d\n", + __func__, + tm->tm_sec, tm->tm_min, tm->tm_hour, + tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); + + /* hours, minutes and seconds */ + buf[PCF8563_REG_SC] = bin2bcd(tm->tm_sec); + buf[PCF8563_REG_MN] = bin2bcd(tm->tm_min); + buf[PCF8563_REG_HR] = bin2bcd(tm->tm_hour); + + buf[PCF8563_REG_DM] = bin2bcd(tm->tm_mday); + + /* month, 1 - 12 */ + buf[PCF8563_REG_MO] = bin2bcd(tm->tm_mon + 1); + + /* year and century */ + buf[PCF8563_REG_YR] = bin2bcd(tm->tm_year % 100); + if (pcf8563->c_polarity ? (tm->tm_year >= 100) : (tm->tm_year < 100)) + buf[PCF8563_REG_MO] |= PCF8563_MO_C; + + buf[PCF8563_REG_DW] = tm->tm_wday & 0x07; + + /* write register's data */ + for (i = 0; i < 7; i++) { + unsigned char data[2] = { PCF8563_REG_SC + i, + buf[PCF8563_REG_SC + i] }; + + err = i2c_master_send(client, data, sizeof(data)); + if (err != sizeof(data)) { + dev_err(&client->dev, + "%s: err=%d addr=%02x, data=%02x\n", + __func__, err, data[0], data[1]); + return -EIO; + } + } + + return 0; +} + +#ifdef CONFIG_RTC_INTF_DEV +static int pcf8563_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg) +{ + struct pcf8563 *pcf8563 = i2c_get_clientdata(to_i2c_client(dev)); + struct rtc_time tm; + + switch (cmd) { + case RTC_VL_READ: + if (pcf8563->voltage_low) + dev_info(dev, "low voltage detected, date/time is not reliable.\n"); + + if (copy_to_user((void __user *)arg, &pcf8563->voltage_low, + sizeof(int))) + return -EFAULT; + return 0; + case RTC_VL_CLR: + /* + * Clear the VL bit in the seconds register in case + * the time has not been set already (which would + * have cleared it). This does not really matter + * because of the cached voltage_low value but do it + * anyway for consistency. + */ + if (pcf8563_get_datetime(to_i2c_client(dev), &tm)) + pcf8563_set_datetime(to_i2c_client(dev), &tm); + + /* Clear the cached value. */ + pcf8563->voltage_low = 0; + + return 0; + default: + return -ENOIOCTLCMD; + } +} +#else +#define pcf8563_rtc_ioctl NULL +#endif + +static int pcf8563_rtc_read_time(struct device *dev, struct rtc_time *tm) +{ + return pcf8563_get_datetime(to_i2c_client(dev), tm); +} + +static int pcf8563_rtc_set_time(struct device *dev, struct rtc_time *tm) +{ + return pcf8563_set_datetime(to_i2c_client(dev), tm); +} + +static const struct rtc_class_ops pcf8563_rtc_ops = { + .ioctl = pcf8563_rtc_ioctl, + .read_time = pcf8563_rtc_read_time, + .set_time = pcf8563_rtc_set_time, +}; + +static int pcf8563_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct pcf8563 *pcf8563; + + dev_dbg(&client->dev, "%s\n", __func__); +printk("rtc pcf8563_probe\n"); + if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) + return -ENODEV; +printk("rtc pcf8563_probe 1\n"); + pcf8563 = devm_kzalloc(&client->dev, sizeof(struct pcf8563), + GFP_KERNEL); + if (!pcf8563) + return -ENOMEM; +printk("rtc pcf8563_probe 2\n"); + dev_info(&client->dev, "chip found, driver version " DRV_VERSION "\n"); + + i2c_set_clientdata(client, pcf8563); + + pcf8563->rtc = devm_rtc_device_register(&client->dev, + pcf8563_driver.driver.name, + &pcf8563_rtc_ops, THIS_MODULE); + + if (IS_ERR(pcf8563->rtc)) + return PTR_ERR(pcf8563->rtc); +printk("rtc pcf8563_probe ok\n"); + return 0; +} + +static int pcf8563_detect(struct i2c_client *new_client, struct i2c_board_info *info) +{ + struct i2c_adapter *adapter = new_client->adapter; + + printk(" richard rtc pcf8563_detect: %s:bus[%d] addr[0x%x]\n", __func__, adapter->nr, new_client->addr); + + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) + return -ENODEV; + + if (crtc_twi_id == adapter->nr) { + printk("rtc pcf8563_detect crtc_twi_id=%d\n",crtc_twi_id); + strlcpy(info->type, "pcf8563", I2C_NAME_SIZE); + return 0; + } + + return -ENODEV; +} + +static int pcf8563_remove(struct i2c_client *client) +{ + return 0; +} + +static const struct i2c_device_id pcf8563_id[] = { + { "pcf8563", 0 }, + //{ "rtc8564", 0 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, pcf8563_id); + +//#ifdef CONFIG_OF +static const struct of_device_id pcf8563_of_match[] = { + { .compatible = "pcf8563", }, + {} +}; +MODULE_DEVICE_TABLE(of, pcf8563_of_match); +//#endif +static const unsigned short normal_i2c[] = { 0x51, I2C_CLIENT_END }; +static struct i2c_driver pcf8563_driver = { + .class = I2C_CLASS_HWMON | I2C_CLASS_SPD, + .driver = { + .name = "pcf8563", + .owner = THIS_MODULE, + .of_match_table = of_match_ptr(pcf8563_of_match), + }, + .probe = pcf8563_probe, + .remove = pcf8563_remove, + .detect = pcf8563_detect, + .id_table = pcf8563_id, + .address_list = normal_i2c, +}; + +static int crtc_fetch_sysconfig_para() +{ + int ret = -1; + + + struct device_node *np = NULL; + np = of_find_node_by_name(NULL,"crtc"); + if (!np) { + printk("ERROR! get crtc failed, func:%s, line:%d\n",__FUNCTION__, __LINE__); + goto devicetree_get_item_err; + } +printk("crtc crtc_fetch_sysconfig_para\n"); + if (!of_device_is_available(np)) { + printk("%s: crtc is not used\n", __func__); + goto devicetree_get_item_err; + }else { + g_crtc_used = 1; + } +printk("crtc crtc_fetch_sysconfig_para crtc_used=%d\n",g_crtc_used); + if(1 == g_crtc_used){ + ret = of_property_read_u32(np, "crtc_twi_id", &crtc_twi_id); + if (ret) { + pr_err("get crtc_twi_id is fail, %d\n", ret); + goto devicetree_get_item_err; + } + + }else{ + pr_err("%s crtc_unused \n",__func__); + } +printk("crtc crtc_fetch_sysconfig_para 2\n"); + return ret; + +devicetree_get_item_err: +printk("crtc crtc_fetch_sysconfig_para 3\n"); + ret = -1; + return ret; + +} +static struct i2c_board_info __initdata pcf8563_i2c_board_info[] = { + { + .type = "pcf8563", + .addr = 0x51, + }, +}; +static int __init rtc_pcf8563_init(void) +{ + int ret; + + + if (crtc_fetch_sysconfig_para()) { + printk("fetch_crtc_sysconfig_para failed!\n"); + return -1; + } + printk("step4 : rtc_pcf8563_init crtc_used=%d,crtc_twi_id=%d\n",g_crtc_used,crtc_twi_id); + + if (g_crtc_used == 0) { + printk("*** crtc_used set to 0 !\n"); + return -1; + } +//gadap = i2c_get_adapter(crtc_twi_id); + ret = i2c_add_driver(&pcf8563_driver); + if (ret < 0) { + printk("add pcf8563 i2c driver failed\n"); + return -ENODEV; + } + /*ret = i2c_register_board_info(crtc_twi_id, pcf8563_i2c_board_info, ARRAY_SIZE(pcf8563_i2c_board_info)); + if (ret < 0) { + printk("rtc_i2c_board_info add failed\n"); + return ret; + } +*/ +printk("step4 : rtc_pcf8563_init ok\n"); + return (ret); +} + +/*----------------------------------------------------------------------------*/ +static void __exit rtc_pcf8563_exit(void) +{ + + i2c_del_driver(&pcf8563_driver); +} + +module_init(rtc_pcf8563_init); +module_exit(rtc_pcf8563_exit); +//module_i2c_driver(pcf8563_driver); + +MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>"); +MODULE_DESCRIPTION("Philips PCF8563/Epson RTC8564 RTC driver"); +MODULE_LICENSE("GPL"); +MODULE_VERSION(DRV_VERSION); diff --git a/lichee/linux-3.10/drivers/rtc/rtc-sunxi.c b/lichee/linux-3.10/drivers/rtc/rtc-sunxi.c index a47ac21..075dc1b 100755 --- a/lichee/linux-3.10/drivers/rtc/rtc-sunxi.c +++ b/lichee/linux-3.10/drivers/rtc/rtc-sunxi.c @@ -448,17 +448,20 @@ static int sunxi_rtc_probe(struct platform_device *pdev)dev_err(&pdev->dev, "Unable to setup RTC data\n");return -ENODEV;} - + chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);if (!chip)return -ENOMEM; - + platform_set_drvdata(pdev, chip);chip->dev = &pdev->dev;res = platform_get_resource(pdev, IORESOURCE_MEM, 0);chip->base = devm_ioremap_resource(&pdev->dev, res); - + + //modify + writel(0, chip->base + SUNXI_VDD_RTC); + if (IS_ERR(chip->base))return PTR_ERR(chip->base);@@ -541,7 +544,7 @@ static int sunxi_rtc_probe(struct platform_device *pdev)dev_info(&pdev->dev, "RTC enabled\n");return 0; - + fail:pm_runtime_put_sync(&pdev->dev);pm_runtime_disable(&pdev->dev); diff --git a/lichee/linux-3.10/drivers/rtc/rtc-sunxi.h b/lichee/linux-3.10/drivers/rtc/rtc-sunxi.h old mode 100644 new mode 100755 index 165ef5e..caf1e11 --- a/lichee/linux-3.10/drivers/rtc/rtc-sunxi.h +++ b/lichee/linux-3.10/drivers/rtc/rtc-sunxi.h @@ -23,6 +23,8 @@#define SUNXI_ALARM_CONFIG 0x0050#define SUNXI_ALRM_WAKEUP_OUTPUT_EN BIT(0)+#define SUNXI_VDD_RTC 0x0190 +/* alarm0 which based on seconds can power on system,* while alarm1 can't, so alarm1 is not used.*/

總結

以上是生活随笔為你收集整理的全志 添加外挂RTC Hym8563的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

av电影在线不卡 | 婷婷六月综合亚洲 | 国产黄色在线网站 | 国产综合精品一区二区三区 | 久久av网址 | 欧美日韩一二三四区 | 久久国产二区 | 免费日韩电影 | 天天操天天操天天操天天操天天操 | 欧美人zozo | 日p视频在线观看 | 欧美大片第1页 | 欧美视频在线观看免费网址 | 天堂av在线 | 久久成人国产精品入口 | 99久热在线精品视频观看 | 国产网站在线免费观看 | 色网站在线| 精品黄色在线观看 | 色婷婷啪啪免费在线电影观看 | 五月婷婷视频 | a黄色片| 在线观看黄色大片 | 有码中文在线 | 国产99色 | 成人18视频 | 6080yy精品一区二区三区 | 日韩精品免费一区二区三区 | 天天干,夜夜爽 | 日韩电影在线观看中文字幕 | 久久香蕉影视 | 最新av免费在线观看 | 国产高清在线一区 | 97成人精品视频在线播放 | 黄色免费大片 | 在线一级片 | 日韩a欧美 | 日韩在线无 | 99久久日韩精品免费热麻豆美女 | 精品在线观看国产 | 99视频在线精品 | 在线视频 你懂得 | 中文字幕一区二区三区在线观看 | 精品成人网 | 91自拍视频在线观看 | 特级毛片网 | 成年人免费av网站 | 精品在线亚洲视频 | 欧美一区二区精品在线 | 狠狠干狠狠插 | 成人在线播放免费观看 | 精品国产观看 | 操一草| 一区二区三区视频在线 | 欧美另类交在线观看 | 麻豆视频在线免费观看 | 日韩高清免费无专码区 | 在线看成人av | 久久久精品99| 黄色av一区二区 | 国产精品久一 | 日本少妇视频 | 91自拍成人 | 91女子私密保健养生少妇 | av一区二区三区在线 | 日韩高清免费在线观看 | 福利一区视频 | 日韩av成人 | 亚洲精品欧美专区 | 精品综合久久久 | 在线久草视频 | 日韩欧美在线第一页 | 久久综合久久综合九色 | 欧美三人交 | 少妇bbbb搡bbbb桶 | 在线观看色网 | 狠狠色丁香婷婷综合欧美 | 久久国内精品视频 | av在线免费在线观看 | 成人午夜影视 | 亚洲影视资源 | 香蕉网在线播放 | 久久久国产在线视频 | 国产精品mv | 在线看福利av | 精品国产免费久久 | 五月婷在线播放 | 久久久久激情 | 五月婷婷激情 | 鲁一鲁影院 | 日韩欧美在线观看一区二区 | 深爱五月激情网 | 综合婷婷丁香 | 亚洲精品一区二区三区高潮 | 亚洲一区二区精品3399 | 91成人在线免费观看 | 免费看一级特黄a大片 | 日韩欧美不卡 | av免费在线观看网站 | 网站在线观看日韩 | 日本一区二区三区免费观看 | 天天操天天色综合 | 日韩亚洲国产中文字幕 | 亚洲女人av | 日韩一区二区免费视频 | 99免费国产| 免费v片| 国产精品1024 | 久久综合五月婷婷 | 日日爱网站 | 国产精品久久久久久久久软件 | 97成人精品区在线播放 | 97在线视频免费看 | 日韩三级.com | 97超碰人人干 | 久久福利精品 | 国产精品久久久久久久久久久免费看 | 在线91色 | 成人在线免费看视频 | 最新亚洲视频 | 久草视频在线免费 | 国产一级在线观看视频 | 免费黄色av片 | 在线免费观看视频一区二区三区 | 亚洲精品乱码久久久久久蜜桃不爽 | 久草在线观看视频免费 | 国产在线观看午夜 | 狠狠狠狠干 | 超碰在线97观看 | 2021久久| 久草观看视频 | 午夜精品视频福利 | 亚洲精品自在在线观看 | 天堂网在线视频 | 国产亚洲小视频 | 中文字幕乱码日本亚洲一区二区 | 国产黄色片久久 | 黄色软件大全网站 | 最新亚洲视频 | 久久精品一区二区三区国产主播 | 成人影视片 | 欧美精彩视频在线观看 | 黄色动态图xx | 久久精品视频3 | 亚洲日本va午夜在线电影 | 最近中文字幕免费视频 | 亚洲精品视频在线观看网站 | 国产亚洲欧美在线视频 | 超碰人人乐 | 国产视频首页 | 色中文字幕在线观看 | 色网站免费在线观看 | 久久久伦理| 国产成人精品久久二区二区 | 国产资源在线播放 | 午夜10000 | 国产美女被啪进深处喷白浆视频 | 国产黄色免费 | 成人99免费视频 | 久艹视频在线观看 | 国产亚洲一区二区在线观看 | 久精品视频在线 | 99视频在线看 | 日韩欧美一区二区在线播放 | 国产亚洲精品久久久久久大师 | 国产污视频在线观看 | 国产h片在线观看 | 日韩网站一区 | 婷婷激情影院 | 国内精自线一二区永久 | 在线影视 一区 二区 三区 | 99久久毛片 | 天堂av网址 | 天堂网一区二区 | 五月天网页 | 久久av电影 | 国产精品婷婷 | 麻豆视频免费在线播放 | 激情欧美在线观看 | 成年人在线免费视频观看 | 天天操天天干天天综合网 | 亚洲欧美国产精品久久久久 | 色多多污污在线观看 | 一区二区三区在线影院 | 婷婷激情av | 国产免费成人 | 亚洲精品播放 | 欧美日韩观看 | 欧美日韩伦理一区 | 国产一区二区免费看 | 亚洲精品 在线视频 | 91人人澡人人爽 | 亚洲成人资源 | 热久久99这里有精品 | 一区二区 不卡 | 国产精品一区二区三区电影 | 亚洲成人黄色av | 欧美日韩aaaa | 中文亚洲欧美日韩 | 成年人三级网站 | 在线一级片 | 国产精品12 | 久久手机在线视频 | 久久久一本精品99久久精品 | 人人澡澡人人 | 在线观看激情av | 在线观看免费视频 | 日韩精品免费一区二区三区 | 成人午夜片av在线看 | 欧美日韩视频精品 | 免费看国产黄色 | 欧美在线一 | 免费三级网 | 国产99久久精品一区二区300 | 久久视频在线观看中文字幕 | 高清精品在线 | 久久久精品在线观看 | 精品产品国产在线不卡 | 在线看片一区 | 五月婷婷中文网 | 97超碰人人澡 | 91精品国产一区二区在线观看 | 日韩v在线 | 黄色在线观看免费网站 | 97在线观视频免费观看 | 国产精品久久在线 | 国产老太婆免费交性大片 | 中文字幕日本特黄aa毛片 | 日韩欧美高清 | 日韩av在线一区二区 | 亚洲男男gⅴgay双龙 | 伊人天天狠天天添日日拍 | 中文字幕乱码电影 | 免费黄色网止 | 久久这里只有精品视频首页 | 免费成人av | 日本高清中文字幕有码在线 | 五月婷在线视频 | 久久久久久视频 | 国产亚洲视频在线免费观看 | 国产九九精品视频 | 久草精品视频在线观看 | 91桃色视频| 久久国产福利 | 99在线热播精品免费99热 | 亚洲欧美视频在线观看 | 亚洲天堂精品视频在线观看 | 视频一区视频二区在线观看 | 国产亚洲精品久久久久久无几年桃 | 成年人免费电影在线观看 | 97电影网手机版 | 欧美精品在线一区二区 | 精品高清视频 | 黄色av一级 | 99r在线精品 | 波多野结衣在线视频免费观看 | 午夜久久福利视频 | 国产亚洲无 | 国产精品久久久av久久久 | 色综合久久精品 | 91视频免费 | www.av中文字幕.com | 欧美韩国在线 | 国产成人精品免高潮在线观看 | 久草在线99 | 久热免费在线 | 午夜精品一区二区国产 | av网在线观看 | 色婷婷亚洲精品 | 午夜精品一二三区 | 精品亚洲午夜久久久久91 | 中文在线字幕免费观 | 久久免费视频观看 | 91网免费看 | 久久久精品亚洲 | 久久99视频 | 精品国产乱码一区二 | 91九色蝌蚪国产 | 国产五月天婷婷 | 亚洲精品视频在线观看免费 | 久久亚洲区 | 日韩区欧美久久久无人区 | 国精产品999国精产品视频 | 超碰人人草人人 | 美女视频黄是免费的 | 超碰久热 | 夜色成人av | 天天天天天天天操 | 亚洲成人av在线播放 | 97天堂网 | 亚洲精品久久激情国产片 | 成人免费在线观看av | 超碰在线最新地址 | 高清在线观看av | 99久久精品国产亚洲 | 国产五月婷婷 | 色射色 | 亚洲午夜精品久久久 | 亚洲综合色av| 成人午夜黄色 | 日韩在线视频免费播放 | 中文字幕在线观看完整版 | 在线观看完整版免费 | 超碰999| 黄色字幕网 | 91观看视频 | 久久伊人精品一区二区三区 | 久久久久久久久久久黄色 | 九九在线国产视频 | 人人盈棋牌 | 日本精品免费看 | 日韩激情在线 | 免费网站看v片在线a | 日韩精品一区二区三区视频播放 | 激情视频在线高清看 | 91免费版成人 | 久久精品精品电影网 | 丝袜美腿av| 国产又粗又长的视频 | 亚洲视频一级 | 亚洲精品乱码久久久久久9色 | 521色香蕉网站在线观看 | 国产色拍| 黄色片网站大全 | 99久久精品午夜一区二区小说 | 操操操日日 | 国产 av 日韩 | 高清不卡一区二区在线 | 久久理论片 | 久久99免费| 在线观看免费av网站 | 亚洲精品国产综合久久 | 中国一级特黄毛片大片久久 | 成人黄色电影免费观看 | 成人免费视频网址 | 激情五月婷婷丁香 | 91精品伦理| 国产又粗又猛又黄视频 | 蜜桃av观看 | 九九视频精品免费 | 国产亚洲精品久久 | 午夜精品一区二区三区在线播放 | 亚洲精品国偷拍自产在线观看蜜桃 | 国产精品白虎 | 9999激情| 一区二区三区高清不卡 | 亚洲免费国产视频 | 亚洲人av免费网站 | 天堂久色| 开心激情久久 | 98精品国产自产在线观看 | 日本一区二区不卡高清 | 成人av资源网 | 99麻豆久久久国产精品免费 | 色在线高清 | 美女免费视频一区二区 | 99人久久精品视频最新地址 | 91九色视频国产 | 亚洲色图27p | 国产午夜免费视频 | 成人免费视频在线观看 | 国产在线观看国语版免费 | 日韩欧美区| 精品久久久久免费极品大片 | 婷婷网五月天 | 国产视频一区二区三区在线 | 国产成人av片| 天天操夜夜干 | 日韩肉感妇bbwbbwbbw | 久久精品理论 | 91午夜精品 | 欧美aaa一级 | 国产免费人成xvideos视频 | 五月婷婷中文字幕 | 婷婷综合av| 91av视屏 | a天堂免费 | 婷婷婷国产在线视频 | www免费网站在线观看 | 久久综合精品国产一区二区三区 | 久久影院一区 | 天天射综合网站 | 天天草天天色 | 久久人人爽人人爽人人片av软件 | 成人av免费在线 | 久久久久久久免费 | 人人玩人人添人人 | 日韩网站在线免费观看 | 黄色小说免费在线观看 | 亚洲激情 在线 | 51精品国自产在线 | 激情开心网站 | 国产成人高清 | 丝袜av网站 | 免费视频三区 | 久久久免费精品视频 | 亚洲理论视频 | 成人看片 | 欧美日韩久久一区 | 免费精品视频在线观看 | 国产精品免费久久久久影院仙踪林 | 91激情| 色天堂在线视频 | 99精品国产99久久久久久97 | 97av在线 | 亚洲aⅴ一区二区三区 | 中文字幕第| 国产精品中文字幕在线播放 | 91亚洲精品久久久 | 精品亚洲欧美无人区乱码 | 天天操天天色综合 | 欧美精品中文在线免费观看 | 91精品国产乱码在线观看 | 美女黄色网在线播放 | 国产三级视频在线 | 麻豆一级视频 | 国产一级免费电影 | 国产精品高清在线观看 | 欧美日韩一区二区免费在线观看 | 网站你懂的 | 日韩在线观看视频免费 | 99久久精品国产亚洲 | 人人搞人人搞 | 日韩激情av在线 | 国产精品乱码高清在线看 | 人人澡人人模 | 天天操天天摸天天射 | 中文字幕在线播放一区二区 | 久久久91精品国产一区二区精品 | 久久96 | 天天夜夜操| 亚洲欧美久久 | 亚洲综合色播 | 久久久久亚洲国产 | 69av国产 | 91av福利视频| 在线视频91| 午夜资源站 | 中文字幕电影高清在线观看 | 免费在线观看午夜视频 | 国产精品免费看 | 在线看国产视频 | 天天操夜夜摸 | 国产麻豆精品免费视频 | 伊人五月天 | 一级黄色片毛片 | 99久久精品国产欧美主题曲 | 在线观看国产区 | 五月天色丁香 | 欧美精彩视频在线观看 | 国产日韩欧美精品在线观看 | 国产精品久久久久久久久岛 | 国产大陆亚洲精品国产 | 国产亚洲aⅴaaaaaa毛片 | 天天干天天干天天干天天干天天干天天干 | 成人a视频 | 久久久久久久久久久精 | 日韩精品一区不卡 | 一区二区三区电影在线播 | 在线精品视频在线观看高清 | 综合网伊人 | 日韩在线免费视频观看 | 久久er99热精品一区二区三区 | 日韩草比 | 国产手机视频在线播放 | 日本性生活免费看 | 91精品国产网站 | 精品免费国产一区二区三区四区 | 久久玖 | 国产精品ⅴa有声小说 | 日韩视频在线观看免费 | 天堂av官网 | 三级黄在线 | 欧美性性网 | 国产成人三级在线 | 九九精品视频在线看 | 成人在线视频在线观看 | 久久国产精品99国产 | 日本女人在线观看 | 最新日韩在线 | 91中文字幕在线 | www.色婷婷 | 亚洲黄色免费 | 亚洲视频1区2区 | 欧洲一区二区在线观看 | 黄色免费在线看 | 国产精品午夜免费福利视频 | 亚洲天堂网站视频 | 日韩欧美在线综合网 | 久久综合之合合综合久久 | 在线视频日韩 | 精品国产aⅴ麻豆 | 欧美激情视频久久 | 中文字幕第一页av | 亚洲欧美成人在线 | 亚洲精品视频在线观看免费视频 | 色视频成人在线观看免 | 麻豆久久一区二区 | 久久精品4 | 97超碰免费在线观看 | 中文字幕在线观看播放 | 亚洲精品视频网站在线观看 | 日韩综合视频在线观看 | 日本特黄一级片 | 久久理论电影 | 成人h视频 | 91免费在线播放 | 色欲综合视频天天天 | 中文国产字幕在线观看 | 成人久久亚洲 | 综合婷婷 | 3d黄动漫免费看 | 性色在线视频 | 91精品视频一区二区三区 | 99久久99久久精品免费 | 91九色最新| 国产精品久久艹 | 久久久久精 | 网站你懂的 | 中文字幕 成人 | 免费观看十分钟 | .国产精品成人自产拍在线观看6 | 免费福利在线观看 | 日韩精品第1页 | 国产一区av在线 | 精品国产人成亚洲区 | 日韩视频专区 | 少妇bbr搡bbb搡bbb | 欧美日韩视频观看 | 1024手机在线看 | 久久99久久99免费视频 | 亚洲国产精品激情在线观看 | 国产精品成人久久久久 | 国产成人精品一区二区三区网站观看 | 婷婷综合影院 | av播放在线 | 91免费视频网站在线观看 | 久久综合五月天婷婷伊人 | 激情黄色av | 午夜久久视频 | 天天射天天操天天色 | 日韩欧美在线综合网 | 欧美一级免费片 | 国产精品乱看 | 欧美精品久久久久久久久久白贞 | 国产黄网站在线观看 | 日韩午夜视频在线观看 | av女优中文字幕在线观看 | 狠狠干天天 | 久久天天拍| 午夜在线日韩 | 日韩免费在线一区 | 国产精品av免费在线观看 | 在线精品观看国产 | www.久久婷婷 | 99精品久久久久久久 | 99操视频 | 国产色视频一区二区三区qq号 | 国产日韩在线看 | 欧美一区二区在线刺激视频 | 成人免费亚洲 | 久久99国产精品 | 亚洲精品裸体 | 国产在线va | 日韩免费av网址 | 丁香久久综合 | av在线播放网址 | 精品极品在线 | 国产精品日韩高清 | 91在线视频观看免费 | 中文字幕一区三区 | 国产精品免费久久久 | 欧美最猛性xxxx | 91喷水| 综合国产视频 | 久久婷婷激情 | 黄色一级网 | 国产中文字幕免费 | 成人久久久久久久久 | 九九九视频精品 | 久久成年人 | 一区中文字幕在线观看 | 992tv在线观看网站 | 一二区电影| 日韩在线视频免费看 | 国产人成一区二区三区影院 | 成人在线免费视频 | 欧美一级大片在线观看 | 国产剧情在线一区 | 日韩毛片在线免费观看 | 日韩在线看片 | 91av精品| 日本黄色免费电影网站 | 中文字幕丰满人伦在线 | 91传媒视频在线观看 | 日韩一区二区三免费高清在线观看 | 免费在线观看午夜视频 | 久草在线视频资源 | a在线观看免费视频 | 中文字幕成人在线观看 | 中文字幕在线观看91 | 久久av网 | 中文字幕欧美激情 | 国产丝袜网站 | 国产精品麻豆免费版 | 午夜美女福利 | 色婷婷狠狠五月综合天色拍 | 日韩视频三区 | www.天天操 | 久久综合中文色婷婷 | 国产r级在线观看 | 亚洲精品国产精品国自产观看 | 精品在线亚洲视频 | 色噜噜在线观看 | 国产精品免费视频观看 | 日韩动态视频 | 狠狠地日 | 五月天久久婷婷 | 久久久久久久久久久国产精品 | 国产亚州av | 国产精品久久久 | 中文永久免费观看 | 欧美一级视频在线观看 | 欧美另类重口 | 欧美国产日韩一区二区三区 | 91久久偷偷做嫩草影院 | 日韩欧美国产激情在线播放 | 99久久精品电影 | 精品福利av | 蜜臀久久99静品久久久久久 | 亚洲一区视频免费观看 | 欧美二区视频 | 在线观看黄网站 | 黄色亚洲在线 | 成年人在线免费视频观看 | 婷婷色资源| 人人爽夜夜爽 | av大全免费在线观看 | 综合伊人久久 | 精品1区二区 | 久热国产视频 | 又黄又刺激视频 | 国产精品久久久久婷婷二区次 | 亚洲乱码精品 | 91精品国产成人观看 | 精品免费观看视频 | 国产精品18videosex性欧美 | 97超碰国产精品女人人人爽 | 一本—道久久a久久精品蜜桃 | 黄色视屏免费在线观看 | 国产福利av在线 | av在线一二三区 | 欧美一区影院 | 国产黄大片在线观看 | 国产精品精品国产婷婷这里av | 久草热视频 | 国产精品免费久久久久影院仙踪林 | 久在线 | 黄色三级久久 | 在线视频a | 日韩一级黄色片 | 免费av成人在线 | 国产精品一区二区久久久久 | 国产精品久久久区三区天天噜 | 综合中文字幕 | 久久精品免视看 | 欧美久久久一区二区三区 | 免费看黄色毛片 | 日韩| 精品黄色在线 | 午夜av片| 日韩久久精品一区二区 | 五月激情婷婷丁香 | 香蕉成人在线视频 | 干干操操| 国产精品免费一区二区三区在线观看 | 在线国产日韩 | 欧美一区日韩一区 | 91av在线播放视频 | 黄色www在线观看 | 婷婷视频在线观看 | 成人av片在线观看 | 久久久综合九色合综国产精品 | 国产91大片| 久草男人天堂 | av色网站 | 最近高清中文在线字幕在线观看 | 午夜999 | 日韩欧美视频一区二区 | 国产精品黄网站在线观看 | 欧美日韩免费一区二区三区 | 国产电影黄色av | 久久久这里有精品 | 91热精品 | 久久九九网站 | 91成人免费在线视频 | 亚洲女同ⅹxx女同tv | 午夜影视剧场 | 久久综合九色综合久久久精品综合 | 国产精品成人一区二区 | 黄色高清视频在线观看 | 成人免费视频网 | 手机av看片| 91精品一区二区三区久久久久久 | 色天堂在线视频 | 五月婷婷丁香六月 | 日韩免费网站 | 九九在线播放 | 色噜噜在线观看 | 免费看三级黄色片 | 国产视频欧美视频 | 99热这里只有精品国产首页 | 色婷婷一区 | 日韩欧美在线综合网 | 1024手机基地在线观看 | 狠狠色丁香婷婷综合欧美 | 午夜三级大片 | 亚洲情感电影大片 | 久久精品久久久久电影 | 亚州国产精品久久久 | 欧美久久久久久久久中文字幕 | 深夜免费福利 | 精品国产一区二区三区日日嗨 | 久草视频免费看 | 五月天色综合 | 91成熟丰满女人少妇 | 欧美日韩国产区 | 免费看黄在线观看 | 国产精品久久久久免费a∨ 欧美一级性生活片 | 91亚色视频在线观看 | 一区二区三区日韩视频在线观看 | av再线观看 | 五月婷视频| 精品国产伦一区二区三区观看说明 | 国产在线观看免 | 久热色超碰 | 99在线高清视频在线播放 | 免费h视频 | www.天天色 | 黄色av一区| 免费精品在线观看 | 免费日韩 | a在线一区| 99久在线精品99re8热视频 | 免费看国产精品 | 久草在线免费电影 | 在线日韩亚洲 | 久久优 | av字幕在线 | 国产黄a三级三级三级三级三级 | 91视频久久久 | 精品免费一区 | 欧美日韩视频免费看 | 久久99免费观看 | 国产91精品高清一区二区三区 | 激情久久一区二区三区 | av在线直接看 | 亚洲一区动漫 | 亚洲一区视频免费观看 | 欧美亚洲成人免费 | av大全在线免费观看 | 人人草人人草 | 成人永久视频 | 亚洲乱码久久久 | 综合网色 | 天天射天天操天天干 | 国产一二三四在线观看视频 | 日韩中文字幕免费视频 | 中文字幕在线网址 | 国产aaa毛片 | 亚洲手机天堂 | 亚洲欧美日韩国产一区二区 | 美女黄久久 | av免费福利 | 亚一亚二国产专区 | 久久综合五月天 | 超碰人人舔| 在线免费成人 | av天天干| 91桃色视频| 色吊丝在线永久观看最新版本 | 国产福利精品在线观看 | 国产日韩欧美自拍 | 国产无套视频 | 黄色日视频 | 久草久草在线观看 | 精品一二三四在线 | 亚洲精品国产拍在线 | 国产精品女人久久久久久 | 婷婷丁香色 | 亚洲第一区精品 | 黄色av免费看 | 色激情五月 | 91九色成人蝌蚪首页 | 9999国产| 91免费高清视频 | 国产精品视频全国免费观看 | 成人黄色小说视频 | 黄色精品久久 | 国产亚洲情侣一区二区无 | 色婷婷综合在线 | 国产自产在线视频 | 国产成人精品免高潮在线观看 | 亚洲激情视频 | 一区三区在线欧 | 久草在线电影网 | 91成人小视频 | 国产中年夫妇高潮精品视频 | 久久黄色小说视频 | 中文字幕资源网 | 免费黄色一区 | 日本精品一二区 | 国产精品久久久久久久久久久免费看 | 亚洲最新av在线网站 | 午夜精品一区二区三区视频免费看 | 欧美一级日韩免费不卡 | 香蕉视频久久久 | 最近免费中文字幕mv在线视频3 | 久久精品4| 欧美性高跟鞋xxxxhd | 最近日本中文字幕a | 日韩国产精品一区 | 黄色成人av网址 | 丁香久久久 | 日韩免费高清在线观看 | av一级片在线观看 | 国产视频久久久久 | 少妇资源站 | 久久久久久欧美二区电影网 | 中文字幕免费 | 精品久久91 | 在线观看黄色的网站 | 九九在线视频免费观看 | 国产成人精品一区二 | 成年美女黄网站色大片免费看 | 97精品欧美91久久久久久 | 亚洲国产成人精品电影在线观看 | 久草手机视频 | 国产精品久久视频 | 久久久久久99精品 | 91av在线视频免费观看 | 黄色一级免费网站 | 中文日韩在线视频 | 91丨精品丨蝌蚪丨白丝jk | 公开超碰在线 | 在线蜜桃视频 | 久久99精品久久久久久清纯直播 | 91禁看片 | 久久久免费毛片 | 久久精品欧美一区 | 免费成人av | 久久都是精品 | 国产在线久草 | 一区二区三区中文字幕在线观看 | 日日夜夜精品 | 欧美91成人网 | 色免费在线 | 毛片美女网站 | 18久久久| 999国内精品永久免费视频 | 国产黄色美女 | 欧美韩国日本在线观看 | 欧美色噜噜 | 久草资源在线 | 欧美日韩国产一区 | 久久精品人人做人人综合老师 | 91视频中文字幕 | 国产黄在线 | 六月色婷 | 国产精品久久久久久久久久免费 | 久久精品亚洲综合专区 | 又黄又爽又刺激 | 五月天高清欧美mv | 麻豆影视在线免费观看 | 女人魂免费观看 | a级国产乱理论片在线观看 特级毛片在线观看 | 久久久黄色 | 中文字幕乱码一区二区 | 久久午夜免费观看 | 黄色的网站免费看 | 狠狠撸电影 | 色婷婷综合五月 | 久久躁日日躁aaaaxxxx | 国产欧美中文字幕 | 国产精品第一页在线 | 久久人人97超碰国产公开结果 | 人人干在线 | 久草免费新视频 | 97超碰超碰久久福利超碰 | 精品免费久久 | 在线影院中文字幕 | 97精品视频在线播放 | 日韩经典一区二区三区 | 亚洲dvd| 亚洲国产成人av网 | 久久精品国产一区二区 | 免费亚洲视频 | 天天操天天草 | 丰满少妇高潮在线观看 | 精品少妇一区二区三区在线 | 在线观看岛国av | 国产91粉嫩白浆在线观看 | 欧美激情视频一区二区三区免费 | 午夜精品一区二区三区在线播放 | 久久系列 | 精品久久久久久久久中文字幕 | 国产精品theporn | 91视频在线免费看 | 午夜视频在线观看一区二区三区 | 免费黄色网址大全 | 久久久九色精品国产一区二区三区 | 日韩二区三区在线观看 | 色综合久久久网 | 国产精品一区免费在线观看 | 久久国产热 | 中文字幕在线中文 | 国产玖玖精品视频 | 精品国产自在精品国产精野外直播 | 综合国产在线 | 97精品国产97久久久久久免费 | 美女亚洲精品 | 99一区二区三区 | 一区二区三区福利 | 日韩久久久久久久 | 亚洲精品视频播放 | 午夜av日韩 | 天堂av在线7 | 五月婷婷精品 | 成人黄色在线观看视频 | 国产精品免费不 | 欧美日韩1区 | 中中文字幕av在线 | 日韩三级av | 97韩国电影| 亚洲成aⅴ人片久久青草影院 | 91视频久久久 | 9999精品免费视频 | 亚洲国产婷婷 | 天天综合网久久综合网 | 久久久久久久久影视 | 成人av资源网站 | 国产日韩亚洲 | 天天综合入口 | 天堂av网址 | 免费a级观看| 国产精品久久久久影视 | 波多野结衣在线中文字幕 | 四虎最新域名 | 在线观看第一页 | 精品国产一区二区三区男人吃奶 | 国产91欧美 | 高清av中文在线字幕观看1 | 五月婷婷色 | 欧美少妇18p | 日韩精品aaa| 天天综合网天天 | 中文字幕乱码日本亚洲一区二区 | 日本中文字幕一二区观 | 久久国产精品偷 | 偷拍区另类综合在线 | 国产精品久久久久久久久久久久久 | 成人精品国产 | 亚洲成人蜜桃 | 亚洲精品在线电影 | 久久九九免费 | 三级黄色三级 | 97超视频 | 国内精品久久久久久久影视简单 | 久久久久久久亚洲精品 | 91大神dom调教在线观看 | 精品久久久久久亚洲综合网站 | 亚洲精品视频国产 | www免费黄色 | 亚洲精品中文字幕视频 | 又黄又爽又无遮挡免费的网站 | 日本三级全黄少妇三2023 | 久久女同性恋中文字幕 | 欧美黑人性爽 | 亚洲国产中文字幕在线 | 91av视频在线观看免费 | 久久人人爽人人爽人人 | 在线看欧美 | 精品欧美小视频在线观看 | 免费日韩一级片 | 久久人人爽人人爽人人片av免费 | 久草新在线 | 一级成人免费视频 | 国产精品精品久久久久久 | 国产精品www | 国产福利网站 | 国产精品高 | 一级理论片在线观看 | 亚洲人成网站精品片在线观看 | 免费av在 | 99精品视频在线免费观看 | 午夜精品一二三区 | av免费看网站 | 中文字幕在线播放第一页 |