Re: [PATCH 1/5] mfd:rtsx: Read vendor setting from config space

2013-07-15 Thread Dan Carpenter
This code has a lot of undocumented magic flags and terrible naming in it. > +static void rtl8411_init_settings(struct rtsx_pcr *pcr) > +{ > + u32 val1; > + u8 val2; These names are 100% useless. "val" means nothing. "1" means nothing. "2" means nothing. In fact, val1 is REG1 and val2

[PATCH 3/5] mfd:rtsx: Move some actions from rtsx_pci_init_hw to individual extra_init_hw

2013-07-15 Thread wei_wang
From: Wei WANG These actions are individual for each reader model, so should be put in extra_init_hw instead of rtsx_pci_init_hw. Signed-off-by: Wei WANG --- drivers/mfd/rts5209.c |4 drivers/mfd/rts5227.c |2 ++ drivers/mfd/rts5229.c |4 drivers/mfd/rts5249.c |2

[PATCH 0/5] mfd:rtsx: MFD patches for Realtek cardreader

2013-07-15 Thread wei_wang
From: Wei WANG Wei WANG (5): mfd:rtsx: Read vendor setting from config space mfd:rtsx: Add shutdown callback in rtsx_pci_driver mfd:rtsx: Move some actions from rtsx_pci_init_hw to individual extra_init_hw mfd:rtsx: Clear hardware PFM mode in rtl8411b mfd:rtsx: Configure to enter a

[PATCH 2/5] mfd:rtsx: Add shutdown callback in rtsx_pci_driver

2013-07-15 Thread wei_wang
From: Wei WANG Some actions to clear power state should be handled in .shutdown callback in rtsx_pci_driver. This patch adopts the following measures to catch this goal: 1. Add a function rtsx_pci_power_off to abstract the common ops in .shutdown and .suspend 2. Add pcr->ops->force_power_down to

[PATCH 4/5] mfd:rtsx: Clear hardware PFM mode in rtl8411b

2013-07-15 Thread wei_wang
From: Wei WANG Clear hw_pfm_en to disable hardware PFM mode, to fix a bug that in some situation registers in 0xFDxx domain can't be accessed. Signed-off-by: Wei WANG --- drivers/mfd/rtl8411.c|2 ++ include/linux/mfd/rtsx_pci.h |1 + 2 files changed, 3 insertions(+) diff --git

[PATCH 5/5] mfd:rtsx: Configure to enter a deeper power-saving mode in S3

2013-07-15 Thread wei_wang
From: Wei WANG Set a bit to enable rts5227 and rts5249 to enter a deeper internal power-saving mode in S3, and recover it after resuming. Signed-off-by: Wei WANG --- drivers/mfd/rtl8411.c|2 +- drivers/mfd/rts5209.c|2 +- drivers/mfd/rts5227.c|6 +- driv

[PATCH 1/5] mfd:rtsx: Read vendor setting from config space

2013-07-15 Thread wei_wang
From: Wei WANG Normally OEMs will set vendor setting to the config space of Realtek card reader in BIOS stage. This patch reads the setting at the first, and configure the internal registers according to it, to improve card reader's compatibility condition. Signed-off-by: Wei WANG --- drivers/