[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20121213133940.18b6d7d4.akpm@linux-foundation.org>
Date: Thu, 13 Dec 2012 13:39:40 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Ashish Jangam <ashish.jangam@...tcummins.com>
Cc: <linux-kernel@...r.kernel.org>, <sameo@...ux.intel.com>,
<p_gortmaker@...oo.com>, <dchen@...semi.com>,
<rtc-linux@...glegroups.com>,
Alessandro Zummo <a.zummo@...ertech.it>,
shubhro <omaplinuxkernel@...il.com>
Subject: Re: [Patch v3 3/7] rtc: DA9055 RTC driver
On Thu, 13 Dec 2012 18:34:20 +0530
Ashish Jangam <ashish.jangam@...tcummins.com> wrote:
> (This rtc patch is resend for merge)
> ---
> This is the RTC patch for the DA9055 PMIC. This patch has got dependency on
> the DA9055 MFD core.
>
> This patch is functionally tested on Samsung SMDKV6410.
>
> ...
>
> +static int __init da9055_rtc_device_init(struct da9055 *da9055,
> + struct da9055_pdata *pdata)
> +{
> + int ret;
> +
> + /* Enable RTC and the internal Crystal */
> + ret = da9055_reg_update(da9055, DA9055_REG_CONTROL_B,
> + DA9055_RTC_EN, DA9055_RTC_EN);
> + if (ret < 0)
> + return ret;
> + ret = da9055_reg_update(da9055, DA9055_REG_EN_32K,
> + DA9055_CRYSTAL_EN, DA9055_CRYSTAL_EN);
> + if (ret < 0)
> + return ret;
> +
> + /* Enable RTC in Power Down mode */
> + ret = da9055_reg_update(da9055, DA9055_REG_CONTROL_B,
> + DA9055_RTC_MODE_PD, DA9055_RTC_MODE_PD);
> + if (ret < 0)
> + return ret;
> +
> + /* Enable RTC in Reset mode */
> + if (pdata && pdata->reset_enable) {
> + ret = da9055_reg_update(da9055, DA9055_REG_CONTROL_B,
> + DA9055_RTC_MODE_SD,
> + DA9055_RTC_MODE_SD <<
> + DA9055_RTC_MODE_SD_SHIFT);
> + if (ret < 0)
> + return ret;
> + }
> +
> + /* Disable the RTC TICK ALM */
> + ret = da9055_reg_update(da9055, DA9055_REG_ALARM_MO,
> + DA9055_RTC_TICK_WAKE_MASK, 0);
> + if (ret < 0)
> + return ret;
If one of these failure paths is taken, the hardware will be left in a
part-initialised state. Is this wise?
> + return 0;
> +}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists