#include <linux/smsc911x.h>
#include <linux/input.h>
#include <linux/gpio_keys.h>
-#include <linux/input/eeti_ts.h>
#include <linux/leds.h>
#include <linux/w1-gpio.h>
#include <linux/sched.h>
.addr = 0x48,
};
-static struct eeti_ts_platform_data eeti_ts_pdata = {
- .irq_active_high = 1,
- .irq_gpio = GPIO_TOUCH_IRQ,
+static struct gpiod_lookup_table raumfeld_controller_gpios_table = {
+ .dev_id = "0-000a",
+ .table = {
+ GPIO_LOOKUP("gpio-pxa",
+ GPIO_TOUCH_IRQ, "attn", GPIO_ACTIVE_HIGH),
+ { },
+ },
};
static const struct resource raumfeld_controller_resources[] = __initconst {
.addr = 0x0a,
.resources = raumfeld_controller_resources,
.num_resources = ARRAY_SIZE(raumfeld_controller_resources),
- .platform_data = &eeti_ts_pdata,
};
static struct platform_device *raumfeld_common_devices[] = {
platform_device_register(&rotary_encoder_device);
spi_register_board_info(ARRAY_AND_SIZE(controller_spi_devices));
+
+ gpiod_add_lookup_table(&raumfeld_controller_gpios_table);
i2c_register_board_info(0, &raumfeld_controller_i2c_board_info, 1);
ret = gpio_request(GPIO_SHUTDOWN_BATT, "battery shutdown");
#include <linux/interrupt.h>
#include <linux/i2c.h>
#include <linux/timer.h>
-#include <linux/gpio.h>
-#include <linux/input/eeti_ts.h>
+#include <linux/gpio/consumer.h>
#include <linux/slab.h>
#include <asm/unaligned.h>
struct eeti_ts {
struct i2c_client *client;
struct input_dev *input;
- int irq_gpio, irq_active_high;
+ struct gpio_desc *attn_gpio;
bool running;
};
#define REPORT_BIT_HAS_PRESSURE BIT(6)
#define REPORT_RES_BITS(v) (((v) >> 1) + EETI_TS_BITDEPTH)
-static inline int eeti_ts_irq_active(struct eeti_ts *eeti)
-{
- return gpio_get_value_cansleep(eeti->irq_gpio) == eeti->irq_active_high;
-}
-
static void eeti_ts_report_event(struct eeti_ts *eeti, u8 *buf)
{
unsigned int res;
/* Motion packet */
eeti_ts_report_event(eeti, buf);
}
- } while (eeti->running && eeti_ts_irq_active(eeti));
+ } while (eeti->running &&
+ eeti->attn_gpio && gpiod_get_value_cansleep(eeti->attn_gpio));
return IRQ_HANDLED;
}
const struct i2c_device_id *idp)
{
struct device *dev = &client->dev;
- struct eeti_ts_platform_data *pdata = dev_get_platdata(dev);
struct eeti_ts *eeti;
struct input_dev *input;
int error;
eeti->client = client;
eeti->input = input;
- eeti->irq_gpio = pdata->irq_gpio;
-
- error = devm_gpio_request_one(dev, pdata->irq_gpio, GPIOF_IN,
- client->name);
- if (error)
- return error;
- eeti->irq_active_high = pdata->irq_active_high;
+ eeti->attn_gpio = devm_gpiod_get_optional(dev, "attn", GPIOD_IN);
+ if (IS_ERR(eeti->attn_gpio))
+ return PTR_ERR(eeti->attn_gpio);
i2c_set_clientdata(client, eeti);
input_set_drvdata(input, eeti);