summaryrefslogtreecommitdiffstats
path: root/drivers/extcon
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski.k@gmail.com>2015-07-15 08:59:51 -0400
committerMark Brown <broonie@kernel.org>2015-07-16 16:39:30 -0400
commitbc1aadc18621ccf93fb33ecbb847b422c354899d (patch)
tree869054114aa849801a112c7691909abd85c3d843 /drivers/extcon
parent61b305cd2ae747b8c9a2e4467dea2575a390162c (diff)
drivers: max77843: Switch to common max77693 state container
Switch to the same definition of state container as in MAX77693 drivers. This will allow usage of one regulator driver in both devices: MAX77693 and MAX77843. Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/extcon')
-rw-r--r--drivers/extcon/extcon-max77843.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/extcon/extcon-max77843.c b/drivers/extcon/extcon-max77843.c
index fac2f1417a79..4dfe0a6337d8 100644
--- a/drivers/extcon/extcon-max77843.c
+++ b/drivers/extcon/extcon-max77843.c
@@ -15,6 +15,7 @@
15#include <linux/i2c.h> 15#include <linux/i2c.h>
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/mfd/max77693-common.h>
18#include <linux/mfd/max77843-private.h> 19#include <linux/mfd/max77843-private.h>
19#include <linux/module.h> 20#include <linux/module.h>
20#include <linux/platform_device.h> 21#include <linux/platform_device.h>
@@ -32,7 +33,7 @@ enum max77843_muic_status {
32 33
33struct max77843_muic_info { 34struct max77843_muic_info {
34 struct device *dev; 35 struct device *dev;
35 struct max77843 *max77843; 36 struct max77693_dev *max77843;
36 struct extcon_dev *edev; 37 struct extcon_dev *edev;
37 38
38 struct mutex mutex; 39 struct mutex mutex;
@@ -198,7 +199,7 @@ static const struct regmap_irq_chip max77843_muic_irq_chip = {
198static int max77843_muic_set_path(struct max77843_muic_info *info, 199static int max77843_muic_set_path(struct max77843_muic_info *info,
199 u8 val, bool attached) 200 u8 val, bool attached)
200{ 201{
201 struct max77843 *max77843 = info->max77843; 202 struct max77693_dev *max77843 = info->max77843;
202 int ret = 0; 203 int ret = 0;
203 unsigned int ctrl1, ctrl2; 204 unsigned int ctrl1, ctrl2;
204 205
@@ -539,7 +540,7 @@ static void max77843_muic_irq_work(struct work_struct *work)
539{ 540{
540 struct max77843_muic_info *info = container_of(work, 541 struct max77843_muic_info *info = container_of(work,
541 struct max77843_muic_info, irq_work); 542 struct max77843_muic_info, irq_work);
542 struct max77843 *max77843 = info->max77843; 543 struct max77693_dev *max77843 = info->max77843;
543 int ret = 0; 544 int ret = 0;
544 545
545 mutex_lock(&info->mutex); 546 mutex_lock(&info->mutex);
@@ -615,7 +616,7 @@ static void max77843_muic_detect_cable_wq(struct work_struct *work)
615{ 616{
616 struct max77843_muic_info *info = container_of(to_delayed_work(work), 617 struct max77843_muic_info *info = container_of(to_delayed_work(work),
617 struct max77843_muic_info, wq_detcable); 618 struct max77843_muic_info, wq_detcable);
618 struct max77843 *max77843 = info->max77843; 619 struct max77693_dev *max77843 = info->max77843;
619 int chg_type, adc, ret; 620 int chg_type, adc, ret;
620 bool attached; 621 bool attached;
621 622
@@ -656,7 +657,7 @@ err_cable_wq:
656static int max77843_muic_set_debounce_time(struct max77843_muic_info *info, 657static int max77843_muic_set_debounce_time(struct max77843_muic_info *info,
657 enum max77843_muic_adc_debounce_time time) 658 enum max77843_muic_adc_debounce_time time)
658{ 659{
659 struct max77843 *max77843 = info->max77843; 660 struct max77693_dev *max77843 = info->max77843;
660 int ret; 661 int ret;
661 662
662 switch (time) { 663 switch (time) {
@@ -681,7 +682,7 @@ static int max77843_muic_set_debounce_time(struct max77843_muic_info *info,
681 return 0; 682 return 0;
682} 683}
683 684
684static int max77843_init_muic_regmap(struct max77843 *max77843) 685static int max77843_init_muic_regmap(struct max77693_dev *max77843)
685{ 686{
686 int ret; 687 int ret;
687 688
@@ -720,7 +721,7 @@ err_muic_i2c:
720 721
721static int max77843_muic_probe(struct platform_device *pdev) 722static int max77843_muic_probe(struct platform_device *pdev)
722{ 723{
723 struct max77843 *max77843 = dev_get_drvdata(pdev->dev.parent); 724 struct max77693_dev *max77843 = dev_get_drvdata(pdev->dev.parent);
724 struct max77843_muic_info *info; 725 struct max77843_muic_info *info;
725 unsigned int id; 726 unsigned int id;
726 int i, ret; 727 int i, ret;
@@ -821,7 +822,7 @@ err_muic_irq:
821static int max77843_muic_remove(struct platform_device *pdev) 822static int max77843_muic_remove(struct platform_device *pdev)
822{ 823{
823 struct max77843_muic_info *info = platform_get_drvdata(pdev); 824 struct max77843_muic_info *info = platform_get_drvdata(pdev);
824 struct max77843 *max77843 = info->max77843; 825 struct max77693_dev *max77843 = info->max77843;
825 826
826 cancel_work_sync(&info->irq_work); 827 cancel_work_sync(&info->irq_work);
827 regmap_del_irq_chip(max77843->irq, max77843->irq_data_muic); 828 regmap_del_irq_chip(max77843->irq, max77843->irq_data_muic);