From: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
To: Guenter Roeck <linux@roeck-us.net>
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
Date: Mon, 28 Jan 2019 18:16:59 +0200 [thread overview]
Message-ID: <20190128161659.GA2121@localhost.localdomain> (raw)
In-Reply-To: <11ff93bf-c71f-7489-841f-09bf757a8ba7@roeck-us.net>
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
next prev parent reply other threads:[~2019-01-28 16:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-25 11:05 [RFC PATCH v2 08/10] rtc: bd70528: Initial support for ROHM bd70528 RTC Matti Vaittinen
2019-01-26 16:30 ` Guenter Roeck
2019-01-28 7:48 ` Matti Vaittinen
2019-01-28 14:02 ` Guenter Roeck
2019-01-28 16:16 ` Matti Vaittinen [this message]
2019-01-28 20:26 ` Jerry Hoemann
2019-01-29 7:01 ` Matti Vaittinen
2019-01-30 0:24 ` Jerry Hoemann
2019-01-28 21:20 ` Alexandre Belloni
2019-01-29 11:46 ` Matti Vaittinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190128161659.GA2121@localhost.localdomain \
--to=matti.vaittinen@fi.rohmeurope.com \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@bootlin.com \
--cc=bgolaszewski@baylibre.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.haikola@fi.rohmeurope.com \
--cc=lee.jones@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=mark.rutland@arm.com \
--cc=mazziesaccount@gmail.com \
--cc=mikko.mutanen@fi.rohmeurope.com \
--cc=mturquette@baylibre.com \
--cc=rafael@kernel.org \
--cc=robh+dt@kernel.org \
--cc=sboyd@kernel.org \
--cc=sre@kernel.org \
--cc=wim@linux-watchdog.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.