Re: [PATCH v4 2/2] msm: gpio: Add irq support to v2 gpiolib.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Gregory Bean
Date: Tuesday, November 23, 2010 - 4:08 pm

>> +static inline void set_gpio_bits(unsigned n, void __iomem *reg)

I don't think that will work well, because there are cases where we want
to set or clear more than one bit at a time.  Making these functions
take a bit number as an argument would restrict them to setting or clearing
only one bit at a time, forcing users to call them multiple times to set
or clear more than one bit, meaning lots of readl & writel calls for
compount bit-changes.


If the chip is ever moved, not accounting for the base would produce an error.
I know that 'speculative coding' is frowned upon, but isn't removing an 
addition (as you pointed out, the subtraction is a bug) because this instance
of the chip is at offset zero a little over the top?


Why make two readl/writel call pairs, or have one version of a helper which
can set a single bit and another version which can set more than one
at a time?  That seems really complicated.

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH v4 2/2] msm: gpio: Add irq support to v2 gpiolib., Gregory Bean, (Thu Nov 18, 12:52 pm)
Re: [PATCH v4 2/2] msm: gpio: Add irq support to v2 gpiolib., Janakiram Sistla, (Thu Nov 18, 12:59 pm)
Re: [PATCH v4 2/2] msm: gpio: Add irq support to v2 gpiolib., Janakiram Sistla, (Thu Nov 18, 1:39 pm)
Re: [PATCH v4 2/2] msm: gpio: Add irq support to v2 gpiolib., Janakiram Sistla, (Thu Nov 18, 3:02 pm)
Re: [PATCH v4 2/2] msm: gpio: Add irq support to v2 gpiolib., Janakiram Sistla, (Fri Nov 19, 11:49 am)
Re: [PATCH v4 2/2] msm: gpio: Add irq support to v2 gpiolib., Janakiram Sistla, (Fri Nov 19, 12:09 pm)
Re: [PATCH v4 2/2] msm: gpio: Add irq support to v2 gpiolib., Gregory Bean, (Tue Nov 23, 4:08 pm)