Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3642867imu; Mon, 28 Jan 2019 08:18:23 -0800 (PST) X-Google-Smtp-Source: ALg8bN6i8288df8PI2m1hx4anSYJL5pJrvRSBh+kh8KXTZDCigSNQGAB7qX/hPNdSmpDj1nweSQq X-Received: by 2002:a17:902:a60f:: with SMTP id u15mr21336959plq.275.1548692303287; Mon, 28 Jan 2019 08:18:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548692302; cv=none; d=google.com; s=arc-20160816; b=NiBA2yqr0XETS9gMMPnj+b5b+ex+qtfevts9enoGZWGnA/QjHcDX1ZmYL1BG2ctcmf 9RsnSAT33jfXyyBganY9yDZ66Sp7i0SMhCc1WemtLRY1a1LK4QDvKhrz3Tw2A9Khg7u9 eAX2233DJYkEN7bGZ2659pItsDskXEJAw9wADwEkV4PmSrGRLcTliE00ejjfIfiOsPzU aEhaBHvfY1bJXp1ICuu1hbg1yxpVd2m7pYoLRxU8VyBoU3WlXOHsdeAK4B98L8JyG5d0 00/EUu+0cE04RlMP8Pmq/jKq+BFU0K3+MT/x5GHMsYzBCJ4hjnvcZUYbZHKZTHaxx1hv RgpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=02Z4Y/VtUKNB+3hQYTEh9goJq0x6vAgNA823SkAWJAk=; b=fdCiB82o1HwJpRAiEM3ntYnj6GmFPg/PKgxnCkN/zjW1ZQzrmV4d+Qn2aJ4FxO2ZNO Tv5vM7oeltOBwS5HGmOxJxEK1Y2Dn3i/nwDcfcUFMds8I/YCkKrQw44i+9xHERP/ym9s WZ3kGbYeNpwWwZiiqj342xIUTSaox6/UISnwMYWFa+DCZcH0xVEWvQAedLC+UVDInqIm X/MB0ifTPIVgrvFFztLo7DJRq+68QB2+k7/3ypY6hnfK+R626oeM20ApOA1ZTJ9bgVon Ets361Y28PbnrXeZyS9qyekiUgrKGWUmMuO0wwQX1UFqzt0hmy3oGz7YN2Ye0iK34s05 ey3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v19si33982313pfa.80.2019.01.28.08.18.07; Mon, 28 Jan 2019 08:18:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388171AbfA1QRO (ORCPT + 99 others); Mon, 28 Jan 2019 11:17:14 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:45751 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388142AbfA1QRN (ORCPT ); Mon, 28 Jan 2019 11:17:13 -0500 Received: by mail-lj1-f193.google.com with SMTP id s5-v6so14699789ljd.12; Mon, 28 Jan 2019 08:17:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=02Z4Y/VtUKNB+3hQYTEh9goJq0x6vAgNA823SkAWJAk=; b=ZZKQdwiuhat0Xul/nbD0JIgGPKW+3P/vHEyJiFyN4k1xoYK3lwcLpWJs88e9mSUwiP ruhilUDsvYlO+fvOW4yKEC+8p4ViuXIc+rqdlc7T/6XIfNvBVNvQI2yu0FDTAonn1wLU O7EEz7KHyLepqNThPHI5R+2xOmt1KhYBV6Lf+0FvvUwZQYY7A07F9KBEQuaBf1gNydBW kRsC0l9PCwtyZFqkoG+8RddZS+KiDgPTaZogKhM/W+lLt06nPkEZXFnnRVZrmS15wvGs ceOj0oVcO1/cjOxw9i/TgDz7Jom2jdHfI1pss1U+9iDxmh4NFhrc8JcegahhgZ+fhNIT 0lHg== X-Gm-Message-State: AJcUukcZCVgIzpxthOQdmUYAu4fm/0wVMyqFD/5dx0c3kaSecCPlY3qz rFbIilMEf3nAztFovXd/hww= X-Received: by 2002:a2e:6503:: with SMTP id z3-v6mr17780348ljb.153.1548692229874; Mon, 28 Jan 2019 08:17:09 -0800 (PST) Received: from localhost.localdomain (dytkl7s9vpj00trvf9g2y-4.rev.dnainternet.fi. [2001:14bb:410:9dbf:b161:fde8:3a24:e96c]) by smtp.gmail.com with ESMTPSA id 85-v6sm3135206lja.16.2019.01.28.08.17.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Jan 2019 08:17:09 -0800 (PST) Date: Mon, 28 Jan 2019 18:16:59 +0200 From: Matti Vaittinen To: Guenter Roeck Cc: mazziesaccount@gmail.com, heikki.haikola@fi.rohmeurope.com, mikko.mutanen@fi.rohmeurope.com, lee.jones@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, broonie@kernel.org, gregkh@linuxfoundation.org, rafael@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, linus.walleij@linaro.org, bgolaszewski@baylibre.com, sre@kernel.org, lgirdwood@gmail.com, a.zummo@towertech.it, alexandre.belloni@bootlin.com, wim@linux-watchdog.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, linux-watchdog@vger.kernel.org Subject: Re: [RFC PATCH v2 08/10] rtc: bd70528: Initial support for ROHM bd70528 RTC Message-ID: <20190128161659.GA2121@localhost.localdomain> References: <20190125110536.GA29321@localhost.localdomain> <35bbc5b9-5f8c-ec80-3eaa-bb2c0e2812c9@roeck-us.net> <20190128074849.GB2030@localhost.localdomain> <11ff93bf-c71f-7489-841f-09bf757a8ba7@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <11ff93bf-c71f-7489-841f-09bf757a8ba7@roeck-us.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 28, 2019 at 06:02:47AM -0800, Guenter Roeck wrote: > On 1/27/19 11:48 PM, Matti Vaittinen wrote: > > Thanks again Guenter, > > > > On Sat, Jan 26, 2019 at 08:30:24AM -0800, Guenter Roeck wrote: > > > On 1/25/19 3:05 AM, Matti Vaittinen wrote: > > > > +/* > > > > + * We read regs RTC_SEC => RTC_YEAR > > > > + * this struct is ordered according to chip registers. > > > > + * Keep it u8 only to avoid padding issues. > > > > + */ > > > > +struct bd70528_rtc_day { > > > > + u8 sec; > > > > + u8 min; > > > > + u8 hour; > > > > +}; > > > > + > > > > +struct bd70528_rtc_data { > > > > + struct bd70528_rtc_day time; > > > > + u8 week; > > > > + u8 day; > > > > + u8 month; > > > > + u8 year; > > > > +}; > > > > + > > > > +struct bd70528_rtc_wake { > > > > + struct bd70528_rtc_day time; > > > > + u8 ctrl; > > > > +}; > > > > + > > > > +struct bd70528_rtc_alm { > > > > + struct bd70528_rtc_data data; > > > > + u8 alm_mask; > > > > + u8 alm_repeat; > > > > +}; > > > > > > At least some of the above are directly associated with chip registers. > > > I don't think this will work for all architectures without explicit packed > > > attribute. > > > > Allright. I was thinking of that but thought that most of the > > architectures using this PMIC would handle alignments fine if I used > > only u8 members. I did consider using __attribute__((packed)) - but I'm > > not sure if we hit into troubles with that too. I guess some people > > would like to compile kernel with other compiler(s) but gcc - although > > I'm not sure if this should be taken into account. I'll try doing some > > study on this - unless someone replies to this and just tells how this > > should be done. (I am pretty sure I can find the answer from mail > > archives though). I'll try adding some packing hint for compiler at v3. > > > > Use __packed ? Right. That appends to __attribute__((packed)) on gcc. I'll use that. Thanks for the tip :) Br, Matti Vaittinen