Re: [warning: ugly, FYI] battery charging support for sharp sl-5500

From: Pavel Machek
Date: Tue Jul 26 2005 - 15:54:22 EST


Hi!

> > #define SCP_REG_MCR SCP_REG(SCP_MCR)
> > #define SCP_REG_CDR SCP_REG(SCP_CDR)
> > #define SCP_REG_CSR SCP_REG(SCP_CSR)
> > #define SCP_REG_CPR SCP_REG(SCP_CPR)
> > #define SCP_REG_CCR SCP_REG(SCP_CCR)
> > #define SCP_REG_IRR SCP_REG(SCP_IRR)
> > #define SCP_REG_IRM SCP_REG(SCP_IRM)
> > #define SCP_REG_IMR SCP_REG(SCP_IMR)
> > #define SCP_REG_ISR SCP_REG(SCP_ISR)
> > #define SCP_REG_GPCR SCP_REG(SCP_GPCR)
> > #define SCP_REG_GPWR SCP_REG(SCP_GPWR)
> > #define SCP_REG_GPRR SCP_REG(SCP_GPRR)
>
> You'll find the scoop driver deals with the above
> (arch/arm/common/scoop.c).

Thanks.

> > #define FLASH_MEM_BASE 0xe8ffc000
> > #define FLASH_DATA(adr) (*(volatile unsigned int*)(FLASH_MEM_BASE+(adr)))
> > #define FLASH_DATA_F(adr) (*(volatile float32 *)(FLASH_MEM_BASE+(adr)))
> > #define FLASH_MAGIC_CHG(a,b,c,d) ( ( d << 24 ) | ( c << 16 ) | ( b << 8 ) | a )
> >
> > // AD
> > #define FLASH_AD_MAJIC FLASH_MAGIC_CHG('B','V','A','D')
> > #define FLASH_AD_MAGIC_ADR 0x30
> > #define FLASH_AD_DATA_ADR 0x34
>
> and arch/arm/common/sharpsl_param.c with these.

Hmm, I wonder what it wants there... It seems to read some battery
correction value?

> > #define IRQ_GPIO_CO IRQ_GPIO20
> > #define IRQ_GPIO_AC_IN IRQ_GPIO1
>
> There will (or if not, there should) be an equivalent in collie.h for
> the above.
>
> I have similar problems with the corgi battery driver which is probably
> even more of a mess than this. My conclusion is the whole lot needs
> rewriting in a nice fashion before it can be included in mainline. My
> work so far on the corgi code is here:
>
> http://www.rpsys.net/openzaurus/patches/corgi_power-r24.patch
> http://www.rpsys.net/openzaurus/patches/corgi_power1-r1.patch

I'll comment in separate mail.

> I'm making progress in areas but I'm not sure how much can be shared
> between devices. My plan is to split the above into two sections, a
> battery driver and some power management code. The powermanagement code
> can probably then make mainline. The battery driver still needs a lot of
> work.

It looks pretty similar... on the first look.
Pavel
--
teflon -- maybe it is a trademark, but it should not be.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/