Re: [rtc-linux] [PATCH] Add rv3029c2 RTC support

From: Wan ZongShun
Date: Sun Jun 06 2010 - 10:40:54 EST


Hi Gregory,

Your patch has been hung for long time.
I didnot know whether you still want it be merged?

2010/3/25 Gregory Hermant <gregory.hermant@xxxxxxxxxxxxxxxxx>:
>
> Signed-off-by: Gregory Hermant <gregory.hermant@xxxxxxxxxxxxxxxxx>
> ---
> Âdrivers/rtc/Kconfig    Â|  Â9 +
> Âdrivers/rtc/Makefile    |  Â1 +
> Âdrivers/rtc/rtc-rv3029c2.c | Â380 ++++++++++++++++++++++++++++++++++++++++++++
> Â3 files changed, 390 insertions(+), 0 deletions(-)
> Âcreate mode 100644 drivers/rtc/rtc-rv3029c2.c
>
> diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
> index 6a13037..9eb256a 100644
> --- a/drivers/rtc/Kconfig
> +++ b/drivers/rtc/Kconfig
> @@ -324,6 +324,15 @@ config RTC_DRV_RX8025
> Â Â Â Â ÂThis driver can also be built as a module. If so, the module
> Â Â Â Â Âwill be called rtc-rx8025.
>
> +config RTC_DRV_RV3029C2
> + Â Â Â tristate "Micro-crytal RTC"
> + Â Â Â help
> + Â Â Â Â If you say yes here you get support for the Micro-crystal
> + Â Â Â Â RV3029-C2 RTC chips.
> +
> + Â Â Â Â This driver can also be built as a module. If so, the module
> + Â Â Â Â will be called rtc-rv3029c2.
> +
> Âendif # I2C
>
> Âcomment "SPI RTC drivers"
> diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
> index 44ef194..2f6a729 100644
> --- a/drivers/rtc/Makefile
> +++ b/drivers/rtc/Makefile
> @@ -74,6 +74,7 @@ obj-$(CONFIG_RTC_DRV_RP5C01) Â+= rtc-rp5c01.o
> Âobj-$(CONFIG_RTC_DRV_RS5C313) Â+= rtc-rs5c313.o
> Âobj-$(CONFIG_RTC_DRV_RS5C348) Â+= rtc-rs5c348.o
> Âobj-$(CONFIG_RTC_DRV_RS5C372) Â+= rtc-rs5c372.o
> +obj-$(CONFIG_RTC_DRV_RV3029C2) += rtc-rv3029c2.o
> Âobj-$(CONFIG_RTC_DRV_RX8025) Â += rtc-rx8025.o
> Âobj-$(CONFIG_RTC_DRV_RX8581) Â += rtc-rx8581.o
> Âobj-$(CONFIG_RTC_DRV_S35390A) Â+= rtc-s35390a.o
> diff --git a/drivers/rtc/rtc-rv3029c2.c b/drivers/rtc/rtc-rv3029c2.c
> new file mode 100644
> index 0000000..3e61530
> --- /dev/null
> +++ b/drivers/rtc/rtc-rv3029c2.c
> @@ -0,0 +1,380 @@
> +/*
> + * Mcrystal RV-3029C2 rtc class driver
> + *
> + * Author: Gregory Hermant <gregory.hermant@xxxxxxxxxxxxxxxxx>
> + *
> + * based on previously existing rtc class drivers
> + *
> + * 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.
> + *
> + * NOTE: Currently this driver only supports the bare minimum for read
> + * and write the RTC. The extra features provided by this chip
> + * (alarms, trickle charger, eeprom, TÂ compensation) are unavailable.
> + */
> +
> +#include <linux/module.h>
> +#include <linux/i2c.h>
> +#include <linux/bcd.h>
> +#include <linux/rtc.h>
> +
> +#define DRV_VERSION "0.1"
> +
> +/* Register map */
> +/* control section */
> +#define RV3029C2_ONOFF_CTRL Â Â Â Â Â Â0x00
> +#define RV3029C2_IRQ_CTRL Â Â Â Â Â Â Â0x01
> +#define RV3029C2_IRQ_FLAGS Â Â Â Â Â Â 0x02
> +#define RV3029C2_STATUS Â Â Â Â Â Â Â Â Â Â Â Â0x03
> +#define RV3029C2_STATUS_VLOW1 Â Â Â Â Â(1 << 2)
> +#define RV3029C2_STATUS_VLOW2 Â Â Â Â Â(1 << 3)
> +#define RV3029C2_STATUS_SR Â Â Â Â Â Â (1 << 4)
> +#define RV3029C2_STATUS_EEBUSY Â Â Â Â (1 << 7)
> +#define RV3029C2_RST_CTRL Â Â Â Â Â Â Â0x04
> +#define RV3029C2_CONTROL_SECTION_LEN Â 0x05
> +
> +/* watch section */
> +#define RV3029C2_W_SECONDS Â Â Â Â Â Â 0x08
> +#define RV3029C2_W_MINUTES Â Â Â Â Â Â 0x09
> +#define RV3029C2_W_HOURS Â Â Â Â Â Â Â 0x0A
> +#define RV3029C2_REG_HR_12_24 Â Â Â Â Â(1<<6) Â/* 24h/12h mode */
> +#define RV3029C2_REG_HR_PM Â Â Â Â Â Â (1<<5) Â/* PM/AM bit in 12h mode */
> +#define RV3029C2_W_DATE Â Â Â Â Â Â Â Â Â Â Â Â0x0B
> +#define RV3029C2_W_DAYS Â Â Â Â Â Â Â Â Â Â Â Â0x0C
> +#define RV3029C2_W_MONTHS Â Â Â Â Â Â Â0x0D
> +#define RV3029C2_W_YEARS Â Â Â Â Â Â Â 0x0E
> +#define RV3029C2_WATCH_SECTION_LEN Â Â 0x07
> +
> +/* alarm section */
> +#define RV3029C2_A_SC Â Â Â Â Â Â Â Â Â0x10
> +#define RV3029C2_A_MN Â Â Â Â Â Â Â Â Â0x11
> +#define RV3029C2_A_HR Â Â Â Â Â Â Â Â Â0x12
> +#define RV3029C2_A_DT Â Â Â Â Â Â Â Â Â0x13
> +#define RV3029C2_A_DW Â Â Â Â Â Â Â Â Â0x14
> +#define RV3029C2_A_MO Â Â Â Â Â Â Â Â Â0x15
> +#define RV3029C2_A_YR Â Â Â Â Â Â Â Â Â0x16
> +#define RV3029C2_ALARM_SECTION_LEN Â Â 0x07
> +
> +/* timer section */
> +#define RV3029C2_TIMER_LOW Â Â Â Â Â Â Â Â Â Â 0x18
> +#define RV3029C2_TIMER_HIGH Â Â Â Â Â Â Â Â Â Â0x19
> +
> +/* temperature section */
> +#define RV3029C2_TEMP_PAGE Â Â Â Â Â Â Â Â Â Â 0x20
> +
> +/* eeprom data section */
> +#define RV3029C2_E2P_EEDATA1 Â Â Â Â Â Â Â Â Â 0x28
> +#define RV3029C2_E2P_EEDATA2 Â Â Â Â Â Â Â Â Â 0x29
> +
> +/* eeprom control section */
> +#define RV3029C2_CONTROL_E2P_EECTRL Â Â Â Â Â Â0x30
> +#define RV3029C2_TRICKLE_1K Â Â Â Â Â Â Â Â Â Â(1<<0) Â/* Â1K resistance */
> +#define RV3029C2_TRICKLE_5K Â Â Â Â Â Â Â Â Â Â(1<<1) Â/* Â5K resistance */
> +#define RV3029C2_TRICKLE_20K Â Â Â Â Â Â Â Â Â (1<<2) Â/* 20K resistance */
> +#define RV3029C2_TRICKLE_80K Â Â Â Â Â Â Â Â Â (1<<3) Â/* 80K resistance */
> +#define RV3029C2_CONTROL_E2P_XTALOFFSET Â Â Â Â Â Â Â Â0x31
> +#define RV3029C2_CONTROL_E2P_QCOEF Â Â Â Â Â Â 0x32
> +#define RV3029C2_CONTROL_E2P_TURNOVER Â Â Â Â Â0x33
> +
> +/* user ram section */
> +#define RV3029C2_USR1_RAM_PAGE Â Â Â Â Â Â Â Â 0x38
> +#define RV3029C2_USR1_SECTION_LEN Â Â Â Â Â Â Â0x04
> +#define RV3029C2_USR2_RAM_PAGE Â Â Â Â Â Â Â Â 0x3C
> +#define RV3029C2_USR2_SECTION_LEN Â Â Â Â Â Â Â0x04
> +

>From 'timer section' to here, all the Micro definitions format should
be alignment,
I think it looks like good, if so.

> +static struct i2c_driver rv3029c2_driver;
> +
> +static int
> +rv3029c2_i2c_read_regs(struct i2c_client *client, u8 reg, u8 *buf,
> + Â Â Â Â Â Â Â Â Â Â Â unsigned len)
> +{
> + Â Â Â u8 reg_addr[1] = { reg } ;
> + Â Â Â struct i2c_msg msgs[2] = {
> + Â Â Â Â Â Â Â {client->addr, 0, sizeof(reg_addr), reg_addr}
> + Â Â Â Â Â Â Â ,
> + Â Â Â Â Â Â Â {client->addr, I2C_M_RD, len, buf}
> + Â Â Â };
> + Â Â Â int ret;
> +
> + Â Â Â BUG_ON(reg > RV3029C2_USR1_RAM_PAGE + 7);
> + Â Â Â BUG_ON(reg + len > RV3029C2_USR1_RAM_PAGE + 8);
> +
> + Â Â Â ret = i2c_transfer(client->adapter, msgs, 2);
> + Â Â Â if (ret > 0)
> + Â Â Â Â Â Â Â ret = 0;
> + Â Â Â return ret;
> +}
> +
> +static int
> +rv3029c2_i2c_write_regs(struct i2c_client *client, u8 reg, u8 const buf[],
> + Â Â Â Â Â Â Â Â Â Â Â unsigned len)
> +{
> + Â Â Â u8 i2c_buf[8];
> + Â Â Â struct i2c_msg msgs[1] = {
> + Â Â Â Â Â Â Â {client->addr, 0, len + 1, i2c_buf}
> + Â Â Â };
> + Â Â Â int ret;
> +
> + Â Â Â BUG_ON(reg > RV3029C2_USR1_RAM_PAGE + 7);
> + Â Â Â BUG_ON(reg + len > RV3029C2_USR1_RAM_PAGE + 8);
> +
> + Â Â Â i2c_buf[0] = reg;
> + Â Â Â memcpy(&i2c_buf[1], &buf[0], len);
> + Â Â Â ret = i2c_transfer(client->adapter, msgs, 1);
> + Â Â Â if (ret > 0)
> + Â Â Â Â Â Â Â ret = 0;
> + Â Â Â return ret;
> +}
> +
> +/* simple check to see if we have a rv3029c2 */
> +static int
> +rv3029c2_i2c_validate_client(struct i2c_client *client)
> +{
> + Â Â Â u8 regs[RV3029C2_WATCH_SECTION_LEN] = { 0, };
> + Â Â Â u8 zero_mask[RV3029C2_WATCH_SECTION_LEN] = {
> + Â Â Â Â Â Â Â 0x80, 0x80, 0x80, 0xc0, 0xf8, 0xe0, 0x80
> + Â Â Â };
> + Â Â Â int i;
> + Â Â Â int ret;
> +
> + Â Â Â ret = rv3029c2_i2c_read_regs(client, RV3029C2_W_SECONDS, regs,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â RV3029C2_WATCH_SECTION_LEN);
> + Â Â Â if (ret < 0)
> + Â Â Â Â Â Â Â return ret;
> +
> + Â Â Â for (i = 0; i < RV3029C2_WATCH_SECTION_LEN; ++i) {
> + Â Â Â Â Â Â Â if (regs[i] & zero_mask[i]) Â Â /* check if bits are cleared */
> + Â Â Â Â Â Â Â Â Â Â Â return -ENODEV;
> + Â Â Â }
> +
> + Â Â Â return 0;
> +}
> +
> +static int
> +rv3029c2_i2c_get_sr(struct i2c_client *client)
> +{
> + Â Â Â u8 buf[1] = { 0, };
> + Â Â Â int sr = rv3029c2_i2c_read_regs(client, RV3029C2_STATUS, buf, 1);
> + Â Â Â printk(KERN_INFO "status = 0x%.2x (%d)\n", buf[0], buf[0]);

Please don't use printk directly, the dev_[warn/err] is preferd.

> + Â Â Â if (sr < 0)
> + Â Â Â Â Â Â Â return -EIO;
> + Â Â Â return sr;
> +}
> +
> +static int
> +rv3029c2_i2c_read_time(struct i2c_client *client, struct rtc_time *tm)
> +{
> + Â Â Â int sr;
> + Â Â Â u8 regs[RV3029C2_WATCH_SECTION_LEN] = { 0, };
> +
> + Â Â Â sr = rv3029c2_i2c_get_sr(client);
> + Â Â Â if (sr < 0) {
> + Â Â Â Â Â Â Â dev_err(&client->dev, "%s: reading SR failed\n", __func__);
> + Â Â Â Â Â Â Â return -EIO;
> + Â Â Â }
> +
> + Â Â Â sr = rv3029c2_i2c_read_regs(client, RV3029C2_W_SECONDS , regs,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â RV3029C2_WATCH_SECTION_LEN);
> + Â Â Â if (sr < 0) {
> + Â Â Â Â Â Â Â dev_err(&client->dev, "%s: reading RTC section failed\n",
> + Â Â Â Â Â Â Â Â Â Â Â __func__);
> + Â Â Â Â Â Â Â return sr;
> + Â Â Â }
> +
> + Â Â Â tm->tm_sec = bcd2bin(regs[RV3029C2_W_SECONDS-RV3029C2_W_SECONDS]);
> + Â Â Â tm->tm_min = bcd2bin(regs[RV3029C2_W_MINUTES-RV3029C2_W_SECONDS]);
> +
> + Â Â Â /* HR field has a more complex interpretation */
> + Â Â Â {
> + Â Â Â Â Â Â Â const u8 _hr = regs[RV3029C2_W_HOURS-RV3029C2_W_SECONDS];
> + Â Â Â Â Â Â Â if (_hr & RV3029C2_REG_HR_12_24) Â Â Â Â/* 24h format */
> + Â Â Â Â Â Â Â Â Â Â Â tm->tm_hour = bcd2bin(_hr & 0x3f);
> + Â Â Â Â Â Â Â else {
> + Â Â Â Â Â Â Â Â Â Â Â /* 12h format */
> + Â Â Â Â Â Â Â Â Â Â Â tm->tm_hour = bcd2bin(_hr & 0x1f);
> + Â Â Â Â Â Â Â Â Â Â Â if (_hr & RV3029C2_REG_HR_PM) Â /* PM flag set */
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â tm->tm_hour += 12;
> + Â Â Â Â Â Â Â }
> + Â Â Â }
> +
> + Â Â Â tm->tm_mday = bcd2bin(regs[RV3029C2_W_DATE-RV3029C2_W_SECONDS]);
> + Â Â Â tm->tm_mon = bcd2bin(regs[RV3029C2_W_MONTHS-RV3029C2_W_SECONDS])-1 ;
> + Â Â Â tm->tm_year = bcd2bin(regs[RV3029C2_W_YEARS-RV3029C2_W_SECONDS])+100;
> + Â Â Â tm->tm_wday = bcd2bin(regs[RV3029C2_W_DAYS-RV3029C2_W_SECONDS])-1;
> +

When returning 'tm' value, please take advantage of 'rtc_valid_tm(tm)'
to check it.

> + Â Â Â return 0;
> +}
> +
> +static int rv3029c2_rtc_read_time(struct device *dev, struct rtc_time *tm)
> +{
> + Â Â Â return rv3029c2_i2c_read_time(to_i2c_client(dev), tm);
> +}
> +
> +static int
> +rv3029c2_i2c_read_alarm(struct i2c_client *client, struct rtc_wkalrm *alarm)
> +{
> + Â Â Â struct rtc_time *const tm = &alarm->time;
> + Â Â Â int sr;
> + Â Â Â u8 regs[8];
> +
> + Â Â Â sr = rv3029c2_i2c_get_sr(client);
> + Â Â Â if (sr < 0) {
> + Â Â Â Â Â Â Â dev_err(&client->dev, "%s: reading SR failed\n", __func__);
> + Â Â Â Â Â Â Â return -EIO;
> + Â Â Â }
> +
> + Â Â Â sr = rv3029c2_i2c_read_regs(client, RV3029C2_A_SC, regs,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â RV3029C2_ALARM_SECTION_LEN);
> +
> + Â Â Â if (sr < 0) {
> + Â Â Â Â Â Â Â dev_err(&client->dev, "%s: reading alarm section failed\n",
> + Â Â Â Â Â Â Â Â Â Â Â __func__);
> + Â Â Â Â Â Â Â return sr;
> + Â Â Â }
> +
> + Â Â Â tm->tm_sec = bcd2bin(regs[RV3029C2_A_SC-RV3029C2_A_SC] & 0x7f);
> + Â Â Â tm->tm_min = bcd2bin(regs[RV3029C2_A_MN-RV3029C2_A_SC] & 0x7f);
> + Â Â Â tm->tm_hour = bcd2bin(regs[RV3029C2_A_HR-RV3029C2_A_SC] & 0x3f);
> + Â Â Â tm->tm_mday = bcd2bin(regs[RV3029C2_A_DT-RV3029C2_A_SC] & 0x3f);
> + Â Â Â tm->tm_mon = bcd2bin(regs[RV3029C2_A_MO-RV3029C2_A_SC] & 0x1f) - 1;
> + Â Â Â tm->tm_year = bcd2bin(regs[RV3029C2_A_YR-RV3029C2_A_SC] & 0x7f) + 100;
> + Â Â Â tm->tm_wday = bcd2bin(regs[RV3029C2_A_DW-RV3029C2_A_SC] & 0x07) - 1;
> +

Ditto.

> + Â Â Â return 0;
> +}
> +
> +static int
> +rv3029c2_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm)
> +{
> + Â Â Â return rv3029c2_i2c_read_alarm(to_i2c_client(dev), alarm);
> +}
> +
> +static int
> +rv3029c2_i2c_set_time(struct i2c_client *client, struct rtc_time const *tm)
> +{
> + Â Â Â u8 regs[8];
> + Â Â Â int sr;
> +
> + Â Â Â /* The clock has an 8 bit wide bcd-coded register (they never learn)
> + Â Â Â Â* for the year. tm_year is an offset from 1900 and we are interested
> + Â Â Â Â* in the 2000-2099 range, so any value less than 100 is invalid.
> + Â Â Â Â*/
> + Â Â Â if (tm->tm_year < 100)
> + Â Â Â Â Â Â Â return -EINVAL;
> +
> + Â Â Â regs[RV3029C2_W_SECONDS-RV3029C2_W_SECONDS] = bin2bcd(tm->tm_sec);
> + Â Â Â regs[RV3029C2_W_MINUTES-RV3029C2_W_SECONDS] = bin2bcd(tm->tm_min);
> + Â Â Â regs[RV3029C2_W_HOURS-RV3029C2_W_SECONDS] =
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â bin2bcd(tm->tm_hour) | RV3029C2_REG_HR_12_24;
> + Â Â Â regs[RV3029C2_W_DATE-RV3029C2_W_SECONDS] = bin2bcd(tm->tm_mday);
> + Â Â Â regs[RV3029C2_W_MONTHS-RV3029C2_W_SECONDS] = bin2bcd(tm->tm_mon+1);
> + Â Â Â regs[RV3029C2_W_DAYS-RV3029C2_W_SECONDS] = bin2bcd((tm->tm_wday & 7)+1);
> + Â Â Â regs[RV3029C2_W_YEARS-RV3029C2_W_SECONDS] = bin2bcd(tm->tm_year - 100);
> +
> + Â Â Â sr = rv3029c2_i2c_get_sr(client);
> + Â Â Â if (sr < 0) {
> + Â Â Â Â Â Â Â dev_err(&client->dev, "%s: reading SR failed\n", __func__);
> + Â Â Â Â Â Â Â return sr;
> + Â Â Â }
> +
> + Â Â Â sr = rv3029c2_i2c_write_regs(client, RV3029C2_W_SECONDS, regs,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â RV3029C2_WATCH_SECTION_LEN);
> + Â Â Â if (sr < 0)
> + Â Â Â Â Â Â Â return sr;
> +
> + Â Â Â return 0;
> +}
> +
> +static int rv3029c2_rtc_set_time(struct device *dev, struct rtc_time *tm)
> +{
> + Â Â Â return rv3029c2_i2c_set_time(to_i2c_client(dev), tm);
> +}
> +
> +static const struct rtc_class_ops rv3029c2_rtc_ops = {
> + Â Â Â .read_time = rv3029c2_rtc_read_time,
> + Â Â Â .set_time = rv3029c2_rtc_set_time,
> + Â Â Â .read_alarm = rv3029c2_rtc_read_alarm,
> + Â Â Â /*.set_alarm = rv3029c2_rtc_set_alarm, */

Why not implement .set_alarm, but put it marked here?

> +};
> +
> +static int
> +rv3029c2_probe(struct i2c_client *client, const struct i2c_device_id *id)
> +{
> + Â Â Â struct rtc_device *rtc;
> + Â Â Â int rc = 0;
> +
> + Â Â Â if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
> + Â Â Â Â Â Â Â return -ENODEV;
> +
> + Â Â Â if (rv3029c2_i2c_validate_client(client) < 0)
> + Â Â Â Â Â Â Â return -ENODEV;
> +
> + Â Â Â dev_info(&client->dev,
> + Â Â Â Â Â Â Â Â"chip found, driver version " DRV_VERSION "\n");
> +

Kernel have had many print info, so there is no need to 'dev_info' here.

> + Â Â Â rtc = rtc_device_register(rv3029c2_driver.driver.name,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â &client->dev, &rv3029c2_rtc_ops,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â THIS_MODULE);
> +
> + Â Â Â if (IS_ERR(rtc))
> + Â Â Â Â Â Â Â return PTR_ERR(rtc);
> +
> + Â Â Â i2c_set_clientdata(client, rtc);
> +
> + Â Â Â rc = rv3029c2_i2c_get_sr(client);
> + Â Â Â if (rc < 0) {
> + Â Â Â Â Â Â Â dev_err(&client->dev, "reading status failed\n");
> + Â Â Â Â Â Â Â goto exit_unregister;
> + Â Â Â }
> +
> + Â Â Â return 0;
> +
> +exit_unregister:
> + Â Â Â rtc_device_unregister(rtc);
> +
> + Â Â Â return rc;
> +}
> +
> +static int rv3029c2_remove(struct i2c_client *client)
> +{
> + Â Â Â struct rtc_device *rtc = i2c_get_clientdata(client);
> +
> + Â Â Â if (rtc)
> + Â Â Â Â Â Â Â rtc_device_unregister(rtc);

The rtc can't be NULL, Please don't check for it.

> +
> + Â Â Â return 0;
> +}
> +
> +static struct i2c_device_id rv3029c2_id[] = {
> + Â Â Â { "rv3029c2", 0 },
> + Â Â Â { }
> +};
> +MODULE_DEVICE_TABLE(i2c, rv3029c2_id);
> +
> +static struct i2c_driver rv3029c2_driver = {
> + Â Â Â .driver = {
> + Â Â Â Â Â Â Â Â Â.name = "rtc-rv3029c2",
> + Â Â Â Â Â Â Â Â Â},
> + Â Â Â .probe = rv3029c2_probe,
> + Â Â Â .remove = rv3029c2_remove,
> + Â Â Â .id_table = rv3029c2_id,
> +};
> +
> +static int __init rv3029c2_init(void)
> +{
> + Â Â Â return i2c_add_driver(&rv3029c2_driver);
> +}
> +
> +static void __exit rv3029c2_exit(void)
> +{
> + Â Â Â i2c_del_driver(&rv3029c2_driver);
> +}
> +
> +MODULE_AUTHOR("Gregory Hermant <gregory.hermant@xxxxxxxxxxxxxxxxx>");
> +MODULE_DESCRIPTION("Micro crystal RV3029C2 RTC driver");
> +MODULE_LICENSE("GPL");
> +MODULE_VERSION(DRV_VERSION);
> +
> +module_init(rv3029c2_init);
> +module_exit(rv3029c2_exit);

Please put MODULE_XXX at the end rather than module_[init/exit]
> --
> 1.5.6.3
>
> --
> You received this message because you are subscribed to "rtc-linux".
> Membership options at http://groups.google.com/group/rtc-linux .
> Please read http://groups.google.com/group/rtc-linux/web/checklist
> before submitting a driver.
>
> To unsubscribe from this group, send email to rtc-linux+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
>



--
*linux-arm-kernel mailing list
mail addr:linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
you can subscribe by:
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

* linux-arm-NUC900 mailing list
mail addr:NUC900@xxxxxxxxxxxxxxxx
main web: https://groups.google.com/group/NUC900
you can subscribe it by sending me mail:
mcuos.com@xxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/