162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0+ 262306a36Sopenharmony_ci// 362306a36Sopenharmony_ci// VF610 pinctrl driver based on imx pinmux and pinconf core 462306a36Sopenharmony_ci// 562306a36Sopenharmony_ci// Copyright 2013 Freescale Semiconductor, Inc. 662306a36Sopenharmony_ci 762306a36Sopenharmony_ci#include <linux/err.h> 862306a36Sopenharmony_ci#include <linux/init.h> 962306a36Sopenharmony_ci#include <linux/io.h> 1062306a36Sopenharmony_ci#include <linux/mod_devicetable.h> 1162306a36Sopenharmony_ci#include <linux/platform_device.h> 1262306a36Sopenharmony_ci#include <linux/pinctrl/pinctrl.h> 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ci#include "pinctrl-imx.h" 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_cienum vf610_pads { 1762306a36Sopenharmony_ci VF610_PAD_PTA6 = 0, 1862306a36Sopenharmony_ci VF610_PAD_PTA8 = 1, 1962306a36Sopenharmony_ci VF610_PAD_PTA9 = 2, 2062306a36Sopenharmony_ci VF610_PAD_PTA10 = 3, 2162306a36Sopenharmony_ci VF610_PAD_PTA11 = 4, 2262306a36Sopenharmony_ci VF610_PAD_PTA12 = 5, 2362306a36Sopenharmony_ci VF610_PAD_PTA16 = 6, 2462306a36Sopenharmony_ci VF610_PAD_PTA17 = 7, 2562306a36Sopenharmony_ci VF610_PAD_PTA18 = 8, 2662306a36Sopenharmony_ci VF610_PAD_PTA19 = 9, 2762306a36Sopenharmony_ci VF610_PAD_PTA20 = 10, 2862306a36Sopenharmony_ci VF610_PAD_PTA21 = 11, 2962306a36Sopenharmony_ci VF610_PAD_PTA22 = 12, 3062306a36Sopenharmony_ci VF610_PAD_PTA23 = 13, 3162306a36Sopenharmony_ci VF610_PAD_PTA24 = 14, 3262306a36Sopenharmony_ci VF610_PAD_PTA25 = 15, 3362306a36Sopenharmony_ci VF610_PAD_PTA26 = 16, 3462306a36Sopenharmony_ci VF610_PAD_PTA27 = 17, 3562306a36Sopenharmony_ci VF610_PAD_PTA28 = 18, 3662306a36Sopenharmony_ci VF610_PAD_PTA29 = 19, 3762306a36Sopenharmony_ci VF610_PAD_PTA30 = 20, 3862306a36Sopenharmony_ci VF610_PAD_PTA31 = 21, 3962306a36Sopenharmony_ci VF610_PAD_PTB0 = 22, 4062306a36Sopenharmony_ci VF610_PAD_PTB1 = 23, 4162306a36Sopenharmony_ci VF610_PAD_PTB2 = 24, 4262306a36Sopenharmony_ci VF610_PAD_PTB3 = 25, 4362306a36Sopenharmony_ci VF610_PAD_PTB4 = 26, 4462306a36Sopenharmony_ci VF610_PAD_PTB5 = 27, 4562306a36Sopenharmony_ci VF610_PAD_PTB6 = 28, 4662306a36Sopenharmony_ci VF610_PAD_PTB7 = 29, 4762306a36Sopenharmony_ci VF610_PAD_PTB8 = 30, 4862306a36Sopenharmony_ci VF610_PAD_PTB9 = 31, 4962306a36Sopenharmony_ci VF610_PAD_PTB10 = 32, 5062306a36Sopenharmony_ci VF610_PAD_PTB11 = 33, 5162306a36Sopenharmony_ci VF610_PAD_PTB12 = 34, 5262306a36Sopenharmony_ci VF610_PAD_PTB13 = 35, 5362306a36Sopenharmony_ci VF610_PAD_PTB14 = 36, 5462306a36Sopenharmony_ci VF610_PAD_PTB15 = 37, 5562306a36Sopenharmony_ci VF610_PAD_PTB16 = 38, 5662306a36Sopenharmony_ci VF610_PAD_PTB17 = 39, 5762306a36Sopenharmony_ci VF610_PAD_PTB18 = 40, 5862306a36Sopenharmony_ci VF610_PAD_PTB19 = 41, 5962306a36Sopenharmony_ci VF610_PAD_PTB20 = 42, 6062306a36Sopenharmony_ci VF610_PAD_PTB21 = 43, 6162306a36Sopenharmony_ci VF610_PAD_PTB22 = 44, 6262306a36Sopenharmony_ci VF610_PAD_PTC0 = 45, 6362306a36Sopenharmony_ci VF610_PAD_PTC1 = 46, 6462306a36Sopenharmony_ci VF610_PAD_PTC2 = 47, 6562306a36Sopenharmony_ci VF610_PAD_PTC3 = 48, 6662306a36Sopenharmony_ci VF610_PAD_PTC4 = 49, 6762306a36Sopenharmony_ci VF610_PAD_PTC5 = 50, 6862306a36Sopenharmony_ci VF610_PAD_PTC6 = 51, 6962306a36Sopenharmony_ci VF610_PAD_PTC7 = 52, 7062306a36Sopenharmony_ci VF610_PAD_PTC8 = 53, 7162306a36Sopenharmony_ci VF610_PAD_PTC9 = 54, 7262306a36Sopenharmony_ci VF610_PAD_PTC10 = 55, 7362306a36Sopenharmony_ci VF610_PAD_PTC11 = 56, 7462306a36Sopenharmony_ci VF610_PAD_PTC12 = 57, 7562306a36Sopenharmony_ci VF610_PAD_PTC13 = 58, 7662306a36Sopenharmony_ci VF610_PAD_PTC14 = 59, 7762306a36Sopenharmony_ci VF610_PAD_PTC15 = 60, 7862306a36Sopenharmony_ci VF610_PAD_PTC16 = 61, 7962306a36Sopenharmony_ci VF610_PAD_PTC17 = 62, 8062306a36Sopenharmony_ci VF610_PAD_PTD31 = 63, 8162306a36Sopenharmony_ci VF610_PAD_PTD30 = 64, 8262306a36Sopenharmony_ci VF610_PAD_PTD29 = 65, 8362306a36Sopenharmony_ci VF610_PAD_PTD28 = 66, 8462306a36Sopenharmony_ci VF610_PAD_PTD27 = 67, 8562306a36Sopenharmony_ci VF610_PAD_PTD26 = 68, 8662306a36Sopenharmony_ci VF610_PAD_PTD25 = 69, 8762306a36Sopenharmony_ci VF610_PAD_PTD24 = 70, 8862306a36Sopenharmony_ci VF610_PAD_PTD23 = 71, 8962306a36Sopenharmony_ci VF610_PAD_PTD22 = 72, 9062306a36Sopenharmony_ci VF610_PAD_PTD21 = 73, 9162306a36Sopenharmony_ci VF610_PAD_PTD20 = 74, 9262306a36Sopenharmony_ci VF610_PAD_PTD19 = 75, 9362306a36Sopenharmony_ci VF610_PAD_PTD18 = 76, 9462306a36Sopenharmony_ci VF610_PAD_PTD17 = 77, 9562306a36Sopenharmony_ci VF610_PAD_PTD16 = 78, 9662306a36Sopenharmony_ci VF610_PAD_PTD0 = 79, 9762306a36Sopenharmony_ci VF610_PAD_PTD1 = 80, 9862306a36Sopenharmony_ci VF610_PAD_PTD2 = 81, 9962306a36Sopenharmony_ci VF610_PAD_PTD3 = 82, 10062306a36Sopenharmony_ci VF610_PAD_PTD4 = 83, 10162306a36Sopenharmony_ci VF610_PAD_PTD5 = 84, 10262306a36Sopenharmony_ci VF610_PAD_PTD6 = 85, 10362306a36Sopenharmony_ci VF610_PAD_PTD7 = 86, 10462306a36Sopenharmony_ci VF610_PAD_PTD8 = 87, 10562306a36Sopenharmony_ci VF610_PAD_PTD9 = 88, 10662306a36Sopenharmony_ci VF610_PAD_PTD10 = 89, 10762306a36Sopenharmony_ci VF610_PAD_PTD11 = 90, 10862306a36Sopenharmony_ci VF610_PAD_PTD12 = 91, 10962306a36Sopenharmony_ci VF610_PAD_PTD13 = 92, 11062306a36Sopenharmony_ci VF610_PAD_PTB23 = 93, 11162306a36Sopenharmony_ci VF610_PAD_PTB24 = 94, 11262306a36Sopenharmony_ci VF610_PAD_PTB25 = 95, 11362306a36Sopenharmony_ci VF610_PAD_PTB26 = 96, 11462306a36Sopenharmony_ci VF610_PAD_PTB27 = 97, 11562306a36Sopenharmony_ci VF610_PAD_PTB28 = 98, 11662306a36Sopenharmony_ci VF610_PAD_PTC26 = 99, 11762306a36Sopenharmony_ci VF610_PAD_PTC27 = 100, 11862306a36Sopenharmony_ci VF610_PAD_PTC28 = 101, 11962306a36Sopenharmony_ci VF610_PAD_PTC29 = 102, 12062306a36Sopenharmony_ci VF610_PAD_PTC30 = 103, 12162306a36Sopenharmony_ci VF610_PAD_PTC31 = 104, 12262306a36Sopenharmony_ci VF610_PAD_PTE0 = 105, 12362306a36Sopenharmony_ci VF610_PAD_PTE1 = 106, 12462306a36Sopenharmony_ci VF610_PAD_PTE2 = 107, 12562306a36Sopenharmony_ci VF610_PAD_PTE3 = 108, 12662306a36Sopenharmony_ci VF610_PAD_PTE4 = 109, 12762306a36Sopenharmony_ci VF610_PAD_PTE5 = 110, 12862306a36Sopenharmony_ci VF610_PAD_PTE6 = 111, 12962306a36Sopenharmony_ci VF610_PAD_PTE7 = 112, 13062306a36Sopenharmony_ci VF610_PAD_PTE8 = 113, 13162306a36Sopenharmony_ci VF610_PAD_PTE9 = 114, 13262306a36Sopenharmony_ci VF610_PAD_PTE10 = 115, 13362306a36Sopenharmony_ci VF610_PAD_PTE11 = 116, 13462306a36Sopenharmony_ci VF610_PAD_PTE12 = 117, 13562306a36Sopenharmony_ci VF610_PAD_PTE13 = 118, 13662306a36Sopenharmony_ci VF610_PAD_PTE14 = 119, 13762306a36Sopenharmony_ci VF610_PAD_PTE15 = 120, 13862306a36Sopenharmony_ci VF610_PAD_PTE16 = 121, 13962306a36Sopenharmony_ci VF610_PAD_PTE17 = 122, 14062306a36Sopenharmony_ci VF610_PAD_PTE18 = 123, 14162306a36Sopenharmony_ci VF610_PAD_PTE19 = 124, 14262306a36Sopenharmony_ci VF610_PAD_PTE20 = 125, 14362306a36Sopenharmony_ci VF610_PAD_PTE21 = 126, 14462306a36Sopenharmony_ci VF610_PAD_PTE22 = 127, 14562306a36Sopenharmony_ci VF610_PAD_PTE23 = 128, 14662306a36Sopenharmony_ci VF610_PAD_PTE24 = 129, 14762306a36Sopenharmony_ci VF610_PAD_PTE25 = 130, 14862306a36Sopenharmony_ci VF610_PAD_PTE26 = 131, 14962306a36Sopenharmony_ci VF610_PAD_PTE27 = 132, 15062306a36Sopenharmony_ci VF610_PAD_PTE28 = 133, 15162306a36Sopenharmony_ci VF610_PAD_PTA7 = 134, 15262306a36Sopenharmony_ci}; 15362306a36Sopenharmony_ci 15462306a36Sopenharmony_ci/* Pad names for the pinmux subsystem */ 15562306a36Sopenharmony_cistatic const struct pinctrl_pin_desc vf610_pinctrl_pads[] = { 15662306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA6), 15762306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA8), 15862306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA9), 15962306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA10), 16062306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA11), 16162306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA12), 16262306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA16), 16362306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA17), 16462306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA18), 16562306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA19), 16662306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA20), 16762306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA21), 16862306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA22), 16962306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA23), 17062306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA24), 17162306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA25), 17262306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA26), 17362306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA27), 17462306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA28), 17562306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA29), 17662306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA30), 17762306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA31), 17862306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB0), 17962306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB1), 18062306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB2), 18162306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB3), 18262306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB4), 18362306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB5), 18462306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB6), 18562306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB7), 18662306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB8), 18762306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB9), 18862306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB10), 18962306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB11), 19062306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB12), 19162306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB13), 19262306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB14), 19362306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB15), 19462306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB16), 19562306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB17), 19662306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB18), 19762306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB19), 19862306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB20), 19962306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB21), 20062306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB22), 20162306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC0), 20262306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC1), 20362306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC2), 20462306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC3), 20562306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC4), 20662306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC5), 20762306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC6), 20862306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC7), 20962306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC8), 21062306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC9), 21162306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC10), 21262306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC11), 21362306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC12), 21462306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC13), 21562306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC14), 21662306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC15), 21762306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC16), 21862306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC17), 21962306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD31), 22062306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD30), 22162306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD29), 22262306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD28), 22362306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD27), 22462306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD26), 22562306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD25), 22662306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD24), 22762306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD23), 22862306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD22), 22962306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD21), 23062306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD20), 23162306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD19), 23262306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD18), 23362306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD17), 23462306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD16), 23562306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD0), 23662306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD1), 23762306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD2), 23862306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD3), 23962306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD4), 24062306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD5), 24162306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD6), 24262306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD7), 24362306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD8), 24462306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD9), 24562306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD10), 24662306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD11), 24762306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD12), 24862306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTD13), 24962306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB23), 25062306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB24), 25162306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB25), 25262306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB26), 25362306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB27), 25462306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTB28), 25562306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC26), 25662306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC27), 25762306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC28), 25862306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC29), 25962306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC30), 26062306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTC31), 26162306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE0), 26262306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE1), 26362306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE2), 26462306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE3), 26562306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE4), 26662306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE5), 26762306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE6), 26862306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE7), 26962306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE8), 27062306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE9), 27162306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE10), 27262306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE11), 27362306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE12), 27462306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE13), 27562306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE14), 27662306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE15), 27762306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE16), 27862306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE17), 27962306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE18), 28062306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE19), 28162306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE20), 28262306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE21), 28362306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE22), 28462306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE23), 28562306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE24), 28662306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE25), 28762306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE26), 28862306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE27), 28962306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTE28), 29062306a36Sopenharmony_ci IMX_PINCTRL_PIN(VF610_PAD_PTA7), 29162306a36Sopenharmony_ci}; 29262306a36Sopenharmony_ci 29362306a36Sopenharmony_cistatic int vf610_pmx_gpio_set_direction(struct pinctrl_dev *pctldev, 29462306a36Sopenharmony_ci struct pinctrl_gpio_range *range, 29562306a36Sopenharmony_ci unsigned offset, bool input) 29662306a36Sopenharmony_ci{ 29762306a36Sopenharmony_ci struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); 29862306a36Sopenharmony_ci const struct imx_pin_reg *pin_reg; 29962306a36Sopenharmony_ci u32 reg; 30062306a36Sopenharmony_ci 30162306a36Sopenharmony_ci pin_reg = &ipctl->pin_regs[offset]; 30262306a36Sopenharmony_ci if (pin_reg->mux_reg == -1) 30362306a36Sopenharmony_ci return -EINVAL; 30462306a36Sopenharmony_ci 30562306a36Sopenharmony_ci /* IBE always enabled allows us to read the value "on the wire" */ 30662306a36Sopenharmony_ci reg = readl(ipctl->base + pin_reg->mux_reg); 30762306a36Sopenharmony_ci if (input) 30862306a36Sopenharmony_ci reg &= ~0x2; 30962306a36Sopenharmony_ci else 31062306a36Sopenharmony_ci reg |= 0x2; 31162306a36Sopenharmony_ci writel(reg, ipctl->base + pin_reg->mux_reg); 31262306a36Sopenharmony_ci 31362306a36Sopenharmony_ci return 0; 31462306a36Sopenharmony_ci} 31562306a36Sopenharmony_ci 31662306a36Sopenharmony_cistatic const struct imx_pinctrl_soc_info vf610_pinctrl_info = { 31762306a36Sopenharmony_ci .pins = vf610_pinctrl_pads, 31862306a36Sopenharmony_ci .npins = ARRAY_SIZE(vf610_pinctrl_pads), 31962306a36Sopenharmony_ci .flags = SHARE_MUX_CONF_REG | ZERO_OFFSET_VALID, 32062306a36Sopenharmony_ci .gpio_set_direction = vf610_pmx_gpio_set_direction, 32162306a36Sopenharmony_ci .mux_mask = 0x700000, 32262306a36Sopenharmony_ci .mux_shift = 20, 32362306a36Sopenharmony_ci}; 32462306a36Sopenharmony_ci 32562306a36Sopenharmony_cistatic const struct of_device_id vf610_pinctrl_of_match[] = { 32662306a36Sopenharmony_ci { .compatible = "fsl,vf610-iomuxc", }, 32762306a36Sopenharmony_ci { /* sentinel */ } 32862306a36Sopenharmony_ci}; 32962306a36Sopenharmony_ci 33062306a36Sopenharmony_cistatic int vf610_pinctrl_probe(struct platform_device *pdev) 33162306a36Sopenharmony_ci{ 33262306a36Sopenharmony_ci return imx_pinctrl_probe(pdev, &vf610_pinctrl_info); 33362306a36Sopenharmony_ci} 33462306a36Sopenharmony_ci 33562306a36Sopenharmony_cistatic struct platform_driver vf610_pinctrl_driver = { 33662306a36Sopenharmony_ci .driver = { 33762306a36Sopenharmony_ci .name = "vf610-pinctrl", 33862306a36Sopenharmony_ci .of_match_table = vf610_pinctrl_of_match, 33962306a36Sopenharmony_ci .suppress_bind_attrs = true, 34062306a36Sopenharmony_ci }, 34162306a36Sopenharmony_ci .probe = vf610_pinctrl_probe, 34262306a36Sopenharmony_ci}; 34362306a36Sopenharmony_ci 34462306a36Sopenharmony_cistatic int __init vf610_pinctrl_init(void) 34562306a36Sopenharmony_ci{ 34662306a36Sopenharmony_ci return platform_driver_register(&vf610_pinctrl_driver); 34762306a36Sopenharmony_ci} 34862306a36Sopenharmony_ciarch_initcall(vf610_pinctrl_init); 349