aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/extcon/extcon-max77693.c
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2012-10-08 01:41:49 -0400
committerMyungJoo Ham <myungjoo.ham@samsung.com>2012-10-23 03:32:16 -0400
commitf8457d574f680a98c77846a15df13086ab1ab426 (patch)
tree779759dce27c7d36ebdfa13d3fcef9f960600ef6 /drivers/extcon/extcon-max77693.c
parentbf2627d66d416ff438f37643d32866aa93947be6 (diff)
extcon: MAX77693: Add platform data for MUIC device to initialize registers
This patch add platform data for MUIC device to initialize register on probe() call because it should unmask interrupt mask register and initialize some register related to MUIC device. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Diffstat (limited to 'drivers/extcon/extcon-max77693.c')
-rw-r--r--drivers/extcon/extcon-max77693.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
index e0ed622a0df0..cffeab65051e 100644
--- a/drivers/extcon/extcon-max77693.c
+++ b/drivers/extcon/extcon-max77693.c
@@ -651,6 +651,8 @@ out:
651static int __devinit max77693_muic_probe(struct platform_device *pdev) 651static int __devinit max77693_muic_probe(struct platform_device *pdev)
652{ 652{
653 struct max77693_dev *max77693 = dev_get_drvdata(pdev->dev.parent); 653 struct max77693_dev *max77693 = dev_get_drvdata(pdev->dev.parent);
654 struct max77693_platform_data *pdata = dev_get_platdata(max77693->dev);
655 struct max77693_muic_platform_data *muic_pdata = pdata->muic_data;
654 struct max77693_muic_info *info; 656 struct max77693_muic_info *info;
655 int ret, i; 657 int ret, i;
656 u8 id; 658 u8 id;
@@ -721,6 +723,31 @@ static int __devinit max77693_muic_probe(struct platform_device *pdev)
721 goto err_extcon; 723 goto err_extcon;
722 } 724 }
723 725
726 /* Initialize MUIC register by using platform data */
727 for (i = 0 ; i < muic_pdata->num_init_data ; i++) {
728 enum max77693_irq_source irq_src = MAX77693_IRQ_GROUP_NR;
729
730 max77693_write_reg(info->max77693->regmap_muic,
731 muic_pdata->init_data[i].addr,
732 muic_pdata->init_data[i].data);
733
734 switch (muic_pdata->init_data[i].addr) {
735 case MAX77693_MUIC_REG_INTMASK1:
736 irq_src = MUIC_INT1;
737 break;
738 case MAX77693_MUIC_REG_INTMASK2:
739 irq_src = MUIC_INT2;
740 break;
741 case MAX77693_MUIC_REG_INTMASK3:
742 irq_src = MUIC_INT3;
743 break;
744 }
745
746 if (irq_src < MAX77693_IRQ_GROUP_NR)
747 info->max77693->irq_masks_cur[irq_src]
748 = muic_pdata->init_data[i].data;
749 }
750
724 /* Check revision number of MUIC device*/ 751 /* Check revision number of MUIC device*/
725 ret = max77693_read_reg(info->max77693->regmap_muic, 752 ret = max77693_read_reg(info->max77693->regmap_muic,
726 MAX77693_MUIC_REG_ID, &id); 753 MAX77693_MUIC_REG_ID, &id);