2
2
* Base driver for Marvell 88PM8607
3
3
*
4
4
* Copyright (C) 2009 Marvell International Ltd.
5
- * Haojian Zhuang <[email protected] >
5
+ *
6
+ * Author: Haojian Zhuang <[email protected] >
6
7
*
7
8
* This program is free software; you can redistribute it and/or modify
8
9
* it under the terms of the GNU General Public License version 2 as
@@ -140,7 +141,8 @@ static struct resource codec_resources[] = {
140
141
/* Headset insertion or removal */
141
142
{PM8607_IRQ_HEADSET , PM8607_IRQ_HEADSET , "headset" , IORESOURCE_IRQ ,},
142
143
/* Audio short */
143
- {PM8607_IRQ_AUDIO_SHORT , PM8607_IRQ_AUDIO_SHORT , "audio-short" , IORESOURCE_IRQ ,},
144
+ {PM8607_IRQ_AUDIO_SHORT , PM8607_IRQ_AUDIO_SHORT , "audio-short" ,
145
+ IORESOURCE_IRQ ,},
144
146
};
145
147
146
148
static struct resource battery_resources [] = {
@@ -150,10 +152,14 @@ static struct resource battery_resources[] = {
150
152
151
153
static struct resource charger_resources [] = {
152
154
{PM8607_IRQ_CHG , PM8607_IRQ_CHG , "charger detect" , IORESOURCE_IRQ ,},
153
- {PM8607_IRQ_CHG_DONE , PM8607_IRQ_CHG_DONE , "charging done" , IORESOURCE_IRQ ,},
154
- {PM8607_IRQ_CHG_FAIL , PM8607_IRQ_CHG_FAIL , "charging timeout" , IORESOURCE_IRQ ,},
155
- {PM8607_IRQ_CHG_FAULT , PM8607_IRQ_CHG_FAULT , "charging fault" , IORESOURCE_IRQ ,},
156
- {PM8607_IRQ_GPADC1 , PM8607_IRQ_GPADC1 , "battery temperature" , IORESOURCE_IRQ ,},
155
+ {PM8607_IRQ_CHG_DONE , PM8607_IRQ_CHG_DONE , "charging done" ,
156
+ IORESOURCE_IRQ ,},
157
+ {PM8607_IRQ_CHG_FAIL , PM8607_IRQ_CHG_FAIL , "charging timeout" ,
158
+ IORESOURCE_IRQ ,},
159
+ {PM8607_IRQ_CHG_FAULT , PM8607_IRQ_CHG_FAULT , "charging fault" ,
160
+ IORESOURCE_IRQ ,},
161
+ {PM8607_IRQ_GPADC1 , PM8607_IRQ_GPADC1 , "battery temperature" ,
162
+ IORESOURCE_IRQ ,},
157
163
{PM8607_IRQ_VBAT , PM8607_IRQ_VBAT , "battery voltage" , IORESOURCE_IRQ ,},
158
164
{PM8607_IRQ_VCHG , PM8607_IRQ_VCHG , "vchg voltage" , IORESOURCE_IRQ ,},
159
165
};
@@ -568,8 +574,8 @@ static struct irq_domain_ops pm860x_irq_domain_ops = {
568
574
static int device_irq_init (struct pm860x_chip * chip ,
569
575
struct pm860x_platform_data * pdata )
570
576
{
571
- struct i2c_client * i2c = (chip -> id == CHIP_PM8607 ) ? chip -> client \
572
- : chip -> companion ;
577
+ struct i2c_client * i2c = (chip -> id == CHIP_PM8607 ) ?
578
+ chip -> client : chip -> companion ;
573
579
unsigned char status_buf [INT_STATUS_NUM ];
574
580
unsigned long flags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT ;
575
581
int data , mask , ret = - EINVAL ;
@@ -631,8 +637,8 @@ static int device_irq_init(struct pm860x_chip *chip,
631
637
if (!chip -> core_irq )
632
638
goto out ;
633
639
634
- ret = request_threaded_irq (chip -> core_irq , NULL , pm860x_irq , flags | IRQF_ONESHOT ,
635
- "88pm860x" , chip );
640
+ ret = request_threaded_irq (chip -> core_irq , NULL , pm860x_irq ,
641
+ flags | IRQF_ONESHOT , "88pm860x" , chip );
636
642
if (ret ) {
637
643
dev_err (chip -> dev , "Failed to request IRQ: %d\n" , ret );
638
644
chip -> core_irq = 0 ;
@@ -871,7 +877,7 @@ static void device_rtc_init(struct pm860x_chip *chip,
871
877
{
872
878
int ret ;
873
879
874
- if (( pdata == NULL ) )
880
+ if (! pdata )
875
881
return ;
876
882
877
883
rtc_devs [0 ].platform_data = pdata -> rtc ;
@@ -997,8 +1003,9 @@ static void device_8607_init(struct pm860x_chip *chip,
997
1003
ret );
998
1004
break ;
999
1005
default :
1000
- dev_err (chip -> dev , "Failed to detect Marvell 88PM8607. "
1001
- "Chip ID: %02x\n" , ret );
1006
+ dev_err (chip -> dev ,
1007
+ "Failed to detect Marvell 88PM8607. Chip ID: %02x\n" ,
1008
+ ret );
1002
1009
goto out ;
1003
1010
}
1004
1011
@@ -1120,8 +1127,8 @@ static int pm860x_dt_init(struct device_node *np,
1120
1127
ret = of_property_read_u32 (np , "marvell,88pm860x-slave-addr" ,
1121
1128
& pdata -> companion_addr );
1122
1129
if (ret ) {
1123
- dev_err (dev , "Not found \"marvell,88pm860x-slave-addr\" "
1124
- "property\n" );
1130
+ dev_err (dev ,
1131
+ "Not found \"marvell,88pm860x-slave-addr\" property\n" );
1125
1132
pdata -> companion_addr = 0 ;
1126
1133
}
1127
1134
return 0 ;
0 commit comments