18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-or-later
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (C) 2010 Trusted Logic S.A.
48c2ecf20Sopenharmony_ci * modifications copyright (C) 2015 NXP B.V.
58c2ecf20Sopenharmony_ci */
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci#define PN544_MAGIC	0xE9
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci/*
108c2ecf20Sopenharmony_ci * PN544 power control via ioctl
118c2ecf20Sopenharmony_ci * PN544_SET_PWR(0): power off
128c2ecf20Sopenharmony_ci * PN544_SET_PWR(1): power on
138c2ecf20Sopenharmony_ci * PN544_SET_PWR(2): reset and power on with firmware download enabled
148c2ecf20Sopenharmony_ci */
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#define PWR_OFF 0
178c2ecf20Sopenharmony_ci#define PWR_ON  1
188c2ecf20Sopenharmony_ci#define PWR_FW  2
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci#define CLK_OFF 0
218c2ecf20Sopenharmony_ci#define CLK_ON  1
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci#define GPIO_UNUSED -1
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci#define PN544_SET_PWR	_IOW(PN544_MAGIC, 0x01, unsigned int)
268c2ecf20Sopenharmony_ci#define PN54X_CLK_REQ	_IOW(PN544_MAGIC, 0x02, unsigned int)
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_cistruct pn544_i2c_platform_data {
298c2ecf20Sopenharmony_ci	unsigned int irq_gpio;
308c2ecf20Sopenharmony_ci	unsigned int ven_gpio;
318c2ecf20Sopenharmony_ci	unsigned int firm_gpio;
328c2ecf20Sopenharmony_ci	unsigned int clkreq_gpio;
338c2ecf20Sopenharmony_ci	struct regulator *pvdd_reg;
348c2ecf20Sopenharmony_ci	struct regulator *vbat_reg;
358c2ecf20Sopenharmony_ci	struct regulator *pmuvcc_reg;
368c2ecf20Sopenharmony_ci	struct regulator *sevdd_reg;
378c2ecf20Sopenharmony_ci};
38