Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142006
b: refs/heads/master
c: a23a175
h: refs/heads/master
v: v3
  • Loading branch information
Philipp Zabel authored and Samuel Ortiz committed Apr 4, 2009
1 parent b2a7435 commit 461c47d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 24 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: 3206450355100eae8e033645318b95bb60f1faff
refs/heads/master: a23a175795cdb202619ac176129b2f0c2a5c9456
31 changes: 20 additions & 11 deletions trunk/drivers/w1/masters/ds1wm.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/delay.h>
#include <linux/ds1wm.h>
#include <linux/mfd/core.h>
#include <linux/mfd/ds1wm.h>

#include <asm/io.h>

Expand Down Expand Up @@ -89,7 +90,7 @@ struct ds1wm_data {
void __iomem *map;
int bus_shift; /* # of shifts to calc register offsets */
struct platform_device *pdev;
struct ds1wm_platform_data *pdata;
struct mfd_cell *cell;
int irq;
int active_high;
struct clk *clk;
Expand Down Expand Up @@ -217,8 +218,8 @@ static void ds1wm_up(struct ds1wm_data *ds1wm_data)
{
int gclk, divisor;

if (ds1wm_data->pdata->enable)
ds1wm_data->pdata->enable(ds1wm_data->pdev);
if (ds1wm_data->cell->enable)
ds1wm_data->cell->enable(ds1wm_data->pdev);

gclk = clk_get_rate(ds1wm_data->clk);
clk_enable(ds1wm_data->clk);
Expand All @@ -244,8 +245,8 @@ static void ds1wm_down(struct ds1wm_data *ds1wm_data)
ds1wm_write_register(ds1wm_data, DS1WM_INT_EN,
ds1wm_data->active_high ? DS1WM_INTEN_IAS : 0);

if (ds1wm_data->pdata->disable)
ds1wm_data->pdata->disable(ds1wm_data->pdev);
if (ds1wm_data->cell->disable)
ds1wm_data->cell->disable(ds1wm_data->pdev);

clk_disable(ds1wm_data->clk);
}
Expand Down Expand Up @@ -330,13 +331,18 @@ static struct w1_bus_master ds1wm_master = {
static int ds1wm_probe(struct platform_device *pdev)
{
struct ds1wm_data *ds1wm_data;
struct ds1wm_platform_data *plat;
struct ds1wm_driver_data *plat;
struct resource *res;
struct mfd_cell *cell;
int ret;

if (!pdev)
return -ENODEV;

cell = pdev->dev.platform_data;
if (!cell)
return -ENODEV;

ds1wm_data = kzalloc(sizeof(*ds1wm_data), GFP_KERNEL);
if (!ds1wm_data)
return -ENOMEM;
Expand All @@ -348,15 +354,18 @@ static int ds1wm_probe(struct platform_device *pdev)
ret = -ENXIO;
goto err0;
}
ds1wm_data->map = ioremap(res->start, res->end - res->start + 1);
ds1wm_data->map = ioremap(res->start, resource_size(res));
if (!ds1wm_data->map) {
ret = -ENOMEM;
goto err0;
}
plat = pdev->dev.platform_data;
ds1wm_data->bus_shift = plat->bus_shift;
plat = cell->driver_data;

/* calculate bus shift from mem resource */
ds1wm_data->bus_shift = resource_size(res) >> 3;

ds1wm_data->pdev = pdev;
ds1wm_data->pdata = plat;
ds1wm_data->cell = cell;

res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (!res) {
Expand Down
12 changes: 0 additions & 12 deletions trunk/include/linux/ds1wm.h

This file was deleted.

5 changes: 5 additions & 0 deletions trunk/include/linux/mfd/ds1wm.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* MFD cell driver data for the DS1WM driver */

struct ds1wm_driver_data {
int active_high;
};

0 comments on commit 461c47d

Please sign in to comment.