Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 324351
b: refs/heads/master
c: 4bcdea8
h: refs/heads/master
i:
  324349: d55bf59
  324347: 0467d66
  324343: 5b4c3e2
  324335: 8d5e772
  324319: 6190633
  324287: 901c993
  324223: ad8b2cc
  324095: 3da3b06
v: v3
  • Loading branch information
Daniel Mack authored and Greg Kroah-Hartman committed Sep 26, 2012
1 parent 44efc0d commit 1bcfbc7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cbac1a8b89452f378a17cc2c673aca0e53af684d
refs/heads/master: 4bcdea86f176e96d44531c1e54a1b5c92672424d
17 changes: 17 additions & 0 deletions trunk/drivers/misc/lis3lv02d/lis3lv02d_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <linux/workqueue.h>
#include <linux/spi/spi.h>
#include <linux/pm.h>
#include <linux/of.h>
#include <linux/of_platform.h>

#include "lis3lv02d.h"

Expand Down Expand Up @@ -58,6 +60,14 @@ static int lis3_spi_init(struct lis3lv02d *lis3)
static union axis_conversion lis3lv02d_axis_normal =
{ .as_array = { 1, 2, 3 } };

#ifdef CONFIG_OF
static struct of_device_id lis302dl_spi_dt_ids[] = {
{ .compatible = "st,lis302dl-spi" },
{}
};
MODULE_DEVICE_TABLE(of, lis302dl_spi_dt_ids);
#endif

static int __devinit lis302dl_spi_probe(struct spi_device *spi)
{
int ret;
Expand All @@ -75,6 +85,12 @@ static int __devinit lis302dl_spi_probe(struct spi_device *spi)
lis3_dev.irq = spi->irq;
lis3_dev.ac = lis3lv02d_axis_normal;
lis3_dev.pdata = spi->dev.platform_data;

#ifdef CONFIG_OF
if (of_match_device(lis302dl_spi_dt_ids, &spi->dev))
lis3_dev.of_node = spi->dev.of_node;
#endif

spi_set_drvdata(spi, &lis3_dev);

return lis3lv02d_init_device(&lis3_dev);
Expand Down Expand Up @@ -121,6 +137,7 @@ static struct spi_driver lis302dl_spi_driver = {
.name = DRV_NAME,
.owner = THIS_MODULE,
.pm = &lis3lv02d_spi_pm,
.of_match_table = of_match_ptr(lis302dl_spi_dt_ids),
},
.probe = lis302dl_spi_probe,
.remove = __devexit_p(lis302dl_spi_remove),
Expand Down

0 comments on commit 1bcfbc7

Please sign in to comment.