Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754823AbbHNDMT (ORCPT ); Thu, 13 Aug 2015 23:12:19 -0400 Received: from mail-bn1on0117.outbound.protection.outlook.com ([157.56.110.117]:24489 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753079AbbHNDMR (ORCPT ); Thu, 13 Aug 2015 23:12:17 -0400 From: Wang Dongsheng To: Linus Walleij , John Stultz , Alessandro Zummo , "Alexandre Belloni" CC: Shawn Guo , "Nair, Sandeep" , "Hans de Goede" , Huan Wang , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "rtc-linux@googlegroups.com" Subject: RE: [PATCH 2/2] soc/fsl: add ftm alarm driver for ls1021a platform Thread-Topic: [PATCH 2/2] soc/fsl: add ftm alarm driver for ls1021a platform Thread-Index: AQHQ1MP4f7feO5asC02gkGSO02rhIp4J9ZAAgADaepA= Date: Fri, 14 Aug 2015 03:12:13 +0000 Message-ID: References: <1439358807-9024-1-git-send-email-dongsheng.wang@freescale.com> <1439358807-9024-2-git-send-email-dongsheng.wang@freescale.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Dongsheng.Wang@freescale.com; x-originating-ip: [123.151.195.52] x-microsoft-exchange-diagnostics: 1;DM2PR0301MB0878;5:vJAed4cmHXhfWhVIdn/TRvzJC1aQAPKaeMLpeKwkasY0qtzfavey/xcWu0FNSEnuGGmwW5uizaCl2MnGvWeqNsiaX10FlOKbx6yZ+GAWfdkQD8W5UxJn0b+Y6GI0LPRcm0g0YqzXzf8Rmh4n6p5z4A==;24:jqP1RRkkMBDOZU4Qz6S7ahGUI9gc4DywG9zDKECBwWphGd/6vJmoX0/PC31pdoKw73UD+hc4Muqi49XkcZSQgAxBtuX0FVUTK8ztRy44THQ=;20:eFgiTstyQM/qeeozw1hIiPv5EPID32tIo/2k5niBahDG5QcU1Tux2PO8YPe/4OTv3y46aDvhY/aWIOc5zIoKjw== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0878; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:DM2PR0301MB0878;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0878; x-forefront-prvs: 066898046A x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(377454003)(189002)(24454002)(199003)(13464003)(106356001)(106116001)(77156002)(66066001)(62966003)(105586002)(99286002)(74316001)(102836002)(68736005)(77096005)(2900100001)(2950100001)(122556002)(10400500002)(76576001)(92566002)(46102003)(64706001)(40100003)(86362001)(189998001)(5002640100001)(5003600100002)(87936001)(19580395003)(2656002)(19580405001)(5001830100001)(81156007)(5001860100001)(5001960100002)(5001770100001)(97736004)(4001540100001)(101416001)(50986999)(33656002)(54356999)(76176999);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR0301MB0878;H:SN1PR0301MB1616.namprd03.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Aug 2015 03:12:13.5002 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0878 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 base64 to 8bit by mail.home.local id t7E3CPuD029257 Content-Length: 3109 Lines: 74 > -----Original Message----- > From: Linus Walleij [mailto:linus.walleij@linaro.org] > Sent: Thursday, August 13, 2015 9:54 PM > To: Wang Dongsheng-B40534; John Stultz; Alessandro Zummo; Alexandre Belloni > Cc: Shawn Guo; Nair, Sandeep; Hans de Goede; Wang Huan-B18965; linux-arm- > kernel@lists.infradead.org; linux-kernel@vger.kernel.org; rtc- > linux@googlegroups.com > Subject: Re: [PATCH 2/2] soc/fsl: add ftm alarm driver for ls1021a platform > > On Wed, Aug 12, 2015 at 7:53 AM, Dongsheng Wang > wrote: > > > From: Wang Dongsheng > > > > Only Ftm0 can be used when system going to deep sleep. So this driver > > to support ftm0 as a wakeup source. > > > > Signed-off-by: Wang Dongsheng > > --- > > *V2* > > Change Copyright 2014 to 2015. > (...) > > +config FTM_ALARM > > + bool "FTM alarm driver" > > + depends on SOC_LS1021A > > + default n > > + help > > + Say y here to enable FTM alarm support. The FTM alarm provides > > + alarm functions for wakeup system from deep sleep. There is only > > + one FTM can be used in ALARM(FTM 0). > (...) > > +static u32 time_to_cycle(unsigned long time) > > +static u32 cycle_to_time(u32 cycle) > > +static int ftm_set_alarm(u64 cycle) > > +static irqreturn_t ftm_alarm_interrupt(int irq, void *dev_id) > > +static ssize_t ftm_alarm_show(struct device *dev, > > + struct device_attribute *attr, > > + char *buf) > > +static ssize_t ftm_alarm_store(struct device *dev, > > + struct device_attribute *attr, > > + const char *buf, size_t count) > (...) > > +static struct device_attribute ftm_alarm_attributes = __ATTR(ftm_alarm, 0644, > > + ftm_alarm_show, ftm_alarm_store); > > If you're gonna invent ABIs, document then in Documentation/ABI/testing/*. > > But I don't get it. Why is this driver not in drivers/rtc? > > It does a subset of what an RTC does. The ioctl()'s of an RTC > can do what you want to do. And much much more. > > If it can't do all an RTC can do, surely the RTC subsystem > can be augmented to host it anyway. It's way to close to > an RTC to have it's own random sysfs driver like this. > > Unless I'm totally off, rewrite this to an RTC driver and post > it to the RTC maintainers. > FlexTimer is not a RTC device and not have any rtc deivce function. They belong to different devices, why we need to register this to RTC framework? I am confused about this. Now in freescale layerscape platform this driver is only for FlexTimer0, and not fit for each flextimer. Because only FlexTimer0 still turn-on when system in the Deep Sleep. If the "alarm" make you feel confused or mislead you think this is a RTC devices. I think I need to change the "alarm" to "timer". Regards, -Dongsheng ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?