Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 26347
b: refs/heads/master
c: 438f2a7
h: refs/heads/master
i:
  26345: 3676766
  26343: ee7c072
v: v3
  • Loading branch information
Imre Deak authored and Dmitry Torokhov committed Apr 12, 2006
1 parent dbc3f7c commit 04e26f8
Show file tree
Hide file tree
Showing 2 changed files with 20 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: e2aa507a837cbaa376faa3d9f8448ff569d34ccf
refs/heads/master: 438f2a7401ec5d8f85923a7c3e6da444f097a3a1
19 changes: 19 additions & 0 deletions trunk/drivers/input/touchscreen/ads7846.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,21 @@ SHOW(temp1)
SHOW(vaux)
SHOW(vbatt)

static int is_pen_down(struct device *dev)
{
struct ads7846 *ts = dev_get_drvdata(dev);

return ts->pendown;
}

static ssize_t ads7846_pen_down_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
return sprintf(buf, "%u\n", is_pen_down(dev));
}

static DEVICE_ATTR(pen_down, S_IRUGO, ads7846_pen_down_show, NULL);

/*--------------------------------------------------------------------------*/

/*
Expand Down Expand Up @@ -559,6 +574,8 @@ static int __devinit ads7846_probe(struct spi_device *spi)
device_create_file(&spi->dev, &dev_attr_vbatt);
device_create_file(&spi->dev, &dev_attr_vaux);

device_create_file(&spi->dev, &dev_attr_pen_down);

err = input_register_device(input_dev);
if (err)
goto err_free_irq;
Expand All @@ -582,6 +599,8 @@ static int __devexit ads7846_remove(struct spi_device *spi)
if (ts->irq_disabled)
enable_irq(ts->spi->irq);

device_remove_file(&spi->dev, &dev_attr_pen_down);

if (ts->model == 7846) {
device_remove_file(&spi->dev, &dev_attr_temp0);
device_remove_file(&spi->dev, &dev_attr_temp1);
Expand Down

0 comments on commit 04e26f8

Please sign in to comment.