From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Jonghwa Lee <jonghwa3.lee@samsung.com>
Cc: sameo@linux.intel.com, linux-kernel@vger.kernel.org,
cw00.choi@samsung.com, Chiwoong byun <woong.byun@samsung.com>,
Kyungmin Park <kyungmin.park@samsung.com>,
MyungJoo Ham <myungjoo.ham@samsung.com>
Subject: Re: [PATCH] MFD : add MAX77686 mfd driver
Date: Tue, 1 May 2012 17:58:25 +0100 [thread overview]
Message-ID: <20120501165825.GA3264@sirena.org.uk> (raw)
In-Reply-To: <1335776022-4571-1-git-send-email-jonghwa3.lee@samsung.com>
On Mon, Apr 30, 2012 at 05:53:42PM +0900, Jonghwa Lee wrote:
> + if (irq_src & MAX77686_IRQSRC_RTC) {
> +#ifdef CONFIG_RTC_DRV_MAX77686
> + ret = max77686_read_reg(max77686->rtc, MAX77686_RTC_INT,
> + &irq_reg[RTC_INT]);
> +#else
> + ret = -ENODEV;
> +#endif
Why is this in an ifdef? It's not really idiomatic to do this and if
the interrupt is never requested presumably everything should be fine.
> +int max77686_irq_resume(struct max77686_dev *max77686)
> +{
> + if (max77686->irq && max77686->irq_base)
> + max77686_irq_thread(max77686->irq_base, max77686);
> + return 0;
> +}
Why is this needed? I'd expect the parent IRQ controller to notice if
the device is asserting an interrupt when it resumes.
> +int max77686_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest)
> +{
> + struct max77686_dev *max77686 = i2c_get_clientdata(i2c);
> + int ret;
> +
> + mutex_lock(&max77686->iolock);
> + ret = i2c_smbus_read_byte_data(i2c, reg);
> + mutex_unlock(&max77686->iolock);
> + if (ret < 0)
> + return ret;
It would be much better to use regmap for the register I/O since this is
a PMIC and at least the regulator framework (possibly others soon) are
starting to abstract things out using it. It also gets you things like
the debugfs dumps of the register map and so on easily.
> + } else
> + dev_info(max77686->dev, "device found\n");
This isn't relly adding much - can you log a chip revision or anything?
> +#ifdef CONFIG_RTC_DRV_MAX77686
> + max77686->rtc = i2c_new_dummy(i2c->adapter, I2C_ADDR_RTC);
> + i2c_set_clientdata(max77686->rtc, max77686);
> +#endif
Again, it's very odd that this is conditional.
next prev parent reply other threads:[~2012-05-01 16:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-30 8:53 Jonghwa Lee
2012-04-30 9:17 ` Andi Shyti
2012-05-02 5:02 ` jonghwa3.lee
2012-05-02 9:28 ` Andi Shyti
2012-05-01 16:58 ` Mark Brown [this message]
2012-05-02 5:01 ` jonghwa3.lee
2012-05-02 8:52 ` Mark Brown
2012-04-30 8:57 함명주
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=20120501165825.GA3264@sirena.org.uk \
--to=broonie@opensource.wolfsonmicro.com \
--cc=cw00.choi@samsung.com \
--cc=jonghwa3.lee@samsung.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=sameo@linux.intel.com \
--cc=woong.byun@samsung.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome