Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 220614
b: refs/heads/master
c: 7e2bb82
h: refs/heads/master
v: v3
  • Loading branch information
Uwe Kleine-König authored and Samuel Ortiz committed Oct 28, 2010
1 parent 68eb91c commit c7543a1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 99ea2626a75e13ce926af69d96e9ae5bfb62b7ba
refs/heads/master: 7e2bb82ee0d74b621bab452888cc3e7e8a013d0b
27 changes: 9 additions & 18 deletions trunk/drivers/mfd/mc13783-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,10 @@ struct mc13783 {
struct spi_device *spidev;
struct mutex lock;
int irq;
int flags;
int adcflags;

irq_handler_t irqhandler[MC13783_NUM_IRQ];
void *irqdata[MC13783_NUM_IRQ];

/* XXX these should go as platformdata to the regulator subdevice */
struct mc13783_regulator_init_data *regulators;
int num_regulators;
};

#define MC13783_REG_REVISION 7
Expand Down Expand Up @@ -250,7 +246,10 @@ EXPORT_SYMBOL(mc13783_reg_rmw);

int mc13783_get_flags(struct mc13783 *mc13783)
{
return mc13783->flags;
struct mc13783_platform_data *pdata =
dev_get_platdata(&mc13783->spidev->dev);

return pdata->flags;
}
EXPORT_SYMBOL(mc13783_get_flags);

Expand Down Expand Up @@ -493,7 +492,7 @@ static irqreturn_t mc13783_handler_adcdone(int irq, void *data)
return IRQ_HANDLED;
}

#define MC13783_ADC_WORKING (1 << 16)
#define MC13783_ADC_WORKING (1 << 0)

int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode,
unsigned int channel, unsigned int *sample)
Expand All @@ -509,12 +508,12 @@ int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode,

mc13783_lock(mc13783);

if (mc13783->flags & MC13783_ADC_WORKING) {
if (mc13783->adcflags & MC13783_ADC_WORKING) {
ret = -EBUSY;
goto out;
}

mc13783->flags |= MC13783_ADC_WORKING;
mc13783->adcflags |= MC13783_ADC_WORKING;

mc13783_reg_read(mc13783, MC13783_ADC0, &old_adc0);

Expand Down Expand Up @@ -578,7 +577,7 @@ int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode,
/* restore TSMOD */
mc13783_reg_write(mc13783, MC13783_REG_ADC_0, old_adc0);

mc13783->flags &= ~MC13783_ADC_WORKING;
mc13783->adcflags &= ~MC13783_ADC_WORKING;
out:
mc13783_unlock(mc13783);

Expand Down Expand Up @@ -675,14 +674,6 @@ static int mc13783_probe(struct spi_device *spi)
return ret;
}

/* This should go away (BEGIN) */
if (pdata) {
mc13783->flags = pdata->flags;
mc13783->regulators = pdata->regulators;
mc13783->num_regulators = pdata->num_regulators;
}
/* This should go away (END) */

mc13783_unlock(mc13783);

if (pdata->flags & MC13783_USE_ADC)
Expand Down

0 comments on commit c7543a1

Please sign in to comment.