---
name: "ts_setup"
section: "3"
platform: "linux"
package: "tslib"
version: "1.24-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ts_setup"
---

# ts\_setup(3)

find, open and configure a touch screen input device

## NAME

ts\_setup - find, open and configure a touch screen input device

## SYNOPSIS

```
#include <tslib.h>

struct tsdev *ts_setup(const char *dev_name, int nonblock);

```

## DESCRIPTION

**ts\_setup**() will try to find, open and configure the touch screen device. On success it allocates memory for a new touch screen device, opens and links the input event device to it and loads and initialises all modules configured in the tslib configuration file **TSLIB\_CONFFILE.**

If **dev\_name** is **NULL** **ts\_setup**() will use the device defined by the **TSLIB\_TSDEVICE** environment variable.

If **TSLIB\_TSDEVICE** is not defined **ts\_setup**() will try to use following devices:

/dev/input/ts,\
 /dev/input/touchscreen,\
 /dev/touchscreen/ucb1x00.

After that we ts\_setup() scans /dev/input/event\* for the first device with property INPUT\_PROP\_DIRECT.

## RETURN VALUE

A pointer to the opened **struct tsdev** is returned.

## SEE ALSO

[**ts\_open**(3)](/ts_open/3.md), [**ts\_close**(3)](/ts_close/3.md), [**ts\_read**(3)](/ts_read/3.md), [**ts\_config**(3)](/ts_config/3.md), [**ts.conf**(5)](/ts.conf/5.md)
