Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754884AbcLBC1L (ORCPT ); Thu, 1 Dec 2016 21:27:11 -0500 Received: from mail-db5eur01on0059.outbound.protection.outlook.com ([104.47.2.59]:3019 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751234AbcLBC1J (ORCPT ); Thu, 1 Dec 2016 21:27:09 -0500 From: Meng Yi To: Alexandre Belloni CC: "a.zummo@towertech.it" , "rtc-linux@googlegroups.com" , "linux-kernel@vger.kernel.org" Subject: RE: [RFC PATCH] rtc/nxp: add FTM alarm driver as the wakeup source Thread-Topic: [RFC PATCH] rtc/nxp: add FTM alarm driver as the wakeup source Thread-Index: AQHSLZmfOcr+I159UUKSnEgqrnRCnaDFZ7EwgC0R3gCAAbF/oA== Date: Fri, 2 Dec 2016 02:27:06 +0000 Message-ID: References: <1477273336-48449-1-git-send-email-meng.yi@nxp.com> <20161201003222.ih3lxuyfv7xyaget@piout.net> In-Reply-To: <20161201003222.ih3lxuyfv7xyaget@piout.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=meng.yi@nxp.com; x-originating-ip: [199.59.226.141] x-ms-office365-filtering-correlation-id: 032e206d-d740-401f-1ba1-08d41a5ab5c4 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:DB6PR0401MB2632; x-microsoft-exchange-diagnostics: 1;DB6PR0401MB2632;7:cZ1Ge3nUFu4F3zJsBVse18ehVHa74jFQ2M9aiNvM1aBTeYlgkJkCwK9V0Qv1rReQ6BivqRoEOLddg1XGFrE9mj/wUVrcwh3gd8oRusl9wRKW9xJ+o1WMmsD+KExS58T/QIbqutiwOwN/S+ijcvr+QZS2JVeWZthPd/4hUKN31e7E2zsuH4nLpb7I4SEP2A2oZ2TqqbmfEJCO1kF7nmj/zcqnwjGJKVh+JXsQ6PWzajOB+McrKxl9rV0mURIGSjDipAzMWssH67bY56ch5T+j7fcb8NxyXwBgA0RKIP9fmFPFmYpCFuQ/6L7Fh9EEXeFx/yJ6OgZLMiz7Nxo46WOg7/FuxCmXjnJIkQ++gPe7919MuO+ZvG/0Ay403MUAFh/Sh9T6xWV5vzZomkYbFy8ZIeLy1niZnTw4afXFgaHDW6RdVesEkdDPfus4KrgVS2zbpShMjMZ1du8ITDNyhk9Jtg== x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(58145275503218); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(20161123558021)(6047074)(6072148);SRVR:DB6PR0401MB2632;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0401MB2632; x-forefront-prvs: 0144B30E41 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(189002)(199003)(305945005)(110136003)(2906002)(105586002)(7696004)(7846002)(7736002)(68736007)(66066001)(2950100002)(6916009)(189998001)(16601075003)(74316002)(54356999)(76176999)(50986999)(4326007)(9686002)(122556002)(2900100001)(5660300001)(106116001)(92566002)(76576001)(229853002)(8936002)(77096006)(106356001)(6506004)(38730400001)(102836003)(101416001)(6116002)(3846002)(86362001)(3660700001)(39450400002)(3280700002)(39410400001)(33656002)(8676002)(97736004)(81166006)(81156014);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6PR0401MB2632;H:DB6PR0401MB2631.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Dec 2016 02:27:06.3428 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0401MB2632 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id uB22RKix017655 Content-Length: 809 Lines: 33 > > > + > > > +static int nxp_ftm_rtc_read_time(struct device *dev, struct > > > +rtc_time > > > +*tm) { > > > + struct timeval time; > > > + unsigned long local_time; > > > + > > > + do_gettimeofday(&time); > > > + local_time = (u32)(time.tv_sec - (sys_tz.tz_minuteswest * 60)); > > > + rtc_time_to_tm(local_time, tm); > > > + > > > + return 0; > > > +} > > > + > > > > This is not really getting time from the RTC since FTM is not a RTC > > device, But we need to get the time to setup alarm, so we are using system > time for now. > > Anybody have better idea? > > > > No, that seems fine to me. I'll review the rest of the driver. Thanks for your review, any feedback is welcomed! > > > -- > Alexandre Belloni, Free Electrons > Embedded Linux and Kernel engineering > http://free-electrons.com Meng