From patchwork Mon Sep 2 08:24:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antoniu Miclaus X-Patchwork-Id: 13786911 Received: from mx0b-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD778185B7D; Mon, 2 Sep 2024 08:27:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.135.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725265663; cv=none; b=fIcldNzuWtw+njYdaz8lJlptjyAk5aXTB9f1fm78TOIS3pRhlLmETdEhmN/x0LStsPABqYsSY05GHhyCVz4AzyrlvhigLbft/gE8XHFJzwye2YYs3jxc6tp5OHO8FrvumOOzXbuQB0Pa63osULn+4fCejHOUXTNY2lhXNE4WtV0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725265663; c=relaxed/simple; bh=bwCr2cKS3bvq6ljjGjHqWsqogAeGXrGBsmS3vger5CM=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=oPm89UJins3XMDpW7W0hQJwxRj5qDOoqCFIZPZdySEV2hRogw4FhB6wLrZ+KOXj4mVyt52ZfXk2HUE/+pMqP30bJIHU6DBTF35/8tuQejS/ZZRKM7p/6EgEr+O/4griyKOoHgjVtiRK25Tiy/YvzfBT87FYriiNx3gR6sDIMVj4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com; spf=pass smtp.mailfrom=analog.com; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=Eg5rDLZ3; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="Eg5rDLZ3" Received: from pps.filterd (m0375855.ppops.net [127.0.0.1]) by mx0b-00128a01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4823IUPg003128; Mon, 2 Sep 2024 04:27:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h= content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=DKIM; bh=niI3I7JyZS3O6tP9TPghw9Awc8v 0YPXV7qysyszBa1A=; b=Eg5rDLZ3eKtjPeh354ukZKPWaIE6L2tT4GgkaX0ccUD sKlkyr++E+vR9Hxy402sWU8x3cyHlOKO0plFryEN+5ddCqibLLh8qgx7i+bTnof+ p3tiGsZ7PNZc3P61uY8jkp3v/DpRYh18ZxQaIPwF7vlyPhcxKb9xbepB6ULqqJS0 blvhtHUsOGl633HW28K6v5wM13BrqDcjnfy7UCWKdLG/mdPJrl4yPifd/viSGwnq mfJCsfgj8qyZd/P2PTJuG4cePdsduLKZcDbgbFH6eF5weGb16Vj+p7NW8DfcGLYi 58Fl/dV4ZIDZ7+t1ezVkUCjRIUyz2kMo/h4rxqJFycA== Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0b-00128a01.pphosted.com (PPS) with ESMTPS id 41d5bg8vb9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 02 Sep 2024 04:27:24 -0400 (EDT) Received: from ASHBMBX8.ad.analog.com (ASHBMBX8.ad.analog.com [10.64.17.5]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 4828RNRT022710 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 2 Sep 2024 04:27:23 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Mon, 2 Sep 2024 04:27:22 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Mon, 2 Sep 2024 04:27:22 -0400 Received: from amiclaus-VirtualBox.ad.analog.com (AMICLAUS-L02.ad.analog.com [10.48.65.139]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 4828R9oQ014033; Mon, 2 Sep 2024 04:27:12 -0400 From: Antoniu Miclaus To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Hennerich , Antoniu Miclaus , , , Subject: [PATCH v2 1/3] input: touchscreem: ad7877: add match table Date: Mon, 2 Sep 2024 11:24:31 +0300 Message-ID: <20240902082707.4325-1-antoniu.miclaus@analog.com> X-Mailer: git-send-email 2.46.0 Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: HMTvouU1rGNzCmtDj2v7hLqKUcCe7G64 X-Proofpoint-ORIG-GUID: HMTvouU1rGNzCmtDj2v7hLqKUcCe7G64 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-09-02_01,2024-08-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 spamscore=0 phishscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 lowpriorityscore=0 impostorscore=0 mlxscore=0 bulkscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2409020068 Add match table for the ad7877 driver and define the compatible string. Signed-off-by: Antoniu Miclaus --- no changes in v2. drivers/input/touchscreen/ad7877.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c index a0598e9c7aff..7886454a19c6 100644 --- a/drivers/input/touchscreen/ad7877.c +++ b/drivers/input/touchscreen/ad7877.c @@ -805,10 +805,17 @@ static int ad7877_resume(struct device *dev) static DEFINE_SIMPLE_DEV_PM_OPS(ad7877_pm, ad7877_suspend, ad7877_resume); +static const struct of_device_id ad7877_of_match[] = { + { .compatible = "adi,ad7877", }, + { } +}; +MODULE_DEVICE_TABLE(of, ad7877_of_match); + static struct spi_driver ad7877_driver = { .driver = { .name = "ad7877", .dev_groups = ad7877_groups, + .of_match_table = ad7877_of_match, .pm = pm_sleep_ptr(&ad7877_pm), }, .probe = ad7877_probe, From patchwork Mon Sep 2 08:24:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antoniu Miclaus X-Patchwork-Id: 13786912 Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 38CA31865EA; Mon, 2 Sep 2024 08:27:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.135.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725265671; cv=none; b=YdIv1NYhSXcJE7SOrKzvE0lktmPg0GJPHMH1lS7t1S2tpFBmLJnAKXDvR8pIRrTzLeCT892KVrbj6MStVO4IPS5nexPmvLFOhq6Buol+5gXe+0BGz4OlG56XR/ZpH1gJsHfALDU8lEOpezGjH0h4uMMZ/dfLxh64sjoCh1LZ2J8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725265671; c=relaxed/simple; bh=2rV9WA1wgyzNu7CXowfMopgSRtfFPFaKCAR+gsofEsI=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=JyG/spjKB2ZX1A+ETOaTqrsGo9xyC12hYKKNtPwkzn29yQqqhesC2i9dg7sZDV2ucIFhXdhYb02vqqXy2Pzjt0YXpuuHdUmpp0OgSJGOIITKdn+tn9mia8SGAcCCR1rryPkvpS+xiPFgyhhGQGxYMS0gOsaGqMGcML8CZC8GeCc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com; spf=pass smtp.mailfrom=analog.com; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=xh3pE920; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="xh3pE920" Received: from pps.filterd (m0167089.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4825R4sC011481; Mon, 2 Sep 2024 04:27:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=DKIM; bh=dLcIl PPI0BpAh2tyPpPa8zuotT/0hdrn7SOoHSdAkbo=; b=xh3pE920jwxu37nsKt8ol MhkQlorG0nugqCJEBDLOqpz9ye+QAru0ZTZQGbfLxAo6S0BAphCnBK62z5Vb8K29 /7j4u0w0p3NMi1Co2ybh0btGaRfS9Mra7Tk1XNC7KHA3Ga9j81V7qe0uYJZI8QN8 ToqMoE+CjnKirY5Eo8JZejeIVvmPhtNQsnAx83fSgzhRe5ZQywKY9+jXDQmzhxnF ltl7WEOHfU3yWT8sniY5I9y6f6wKBoC3mECGPYDXMYQX+tGz+q96gBmSh3e17vil J1Fv30XNuLvp6vH06wulhVSlhToX2w/+IjQjYGBOZTAp+uQheAvfOS9Fh0QcEN3S A== Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 41c031x5uy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 02 Sep 2024 04:27:46 -0400 (EDT) Received: from ASHBMBX8.ad.analog.com (ASHBMBX8.ad.analog.com [10.64.17.5]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 4828Rj8S022735 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 2 Sep 2024 04:27:45 -0400 Received: from ASHBCASHYB4.ad.analog.com (10.64.17.132) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Mon, 2 Sep 2024 04:27:44 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBCASHYB4.ad.analog.com (10.64.17.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Mon, 2 Sep 2024 04:27:43 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Mon, 2 Sep 2024 04:27:43 -0400 Received: from amiclaus-VirtualBox.ad.analog.com (AMICLAUS-L02.ad.analog.com [10.48.65.139]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 4828R9oR014033; Mon, 2 Sep 2024 04:27:37 -0400 From: Antoniu Miclaus To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Hennerich , Antoniu Miclaus , , , Subject: [PATCH v2 2/3] input: touchscreen: ad7877: add dt support Date: Mon, 2 Sep 2024 11:24:32 +0300 Message-ID: <20240902082707.4325-2-antoniu.miclaus@analog.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240902082707.4325-1-antoniu.miclaus@analog.com> References: <20240902082707.4325-1-antoniu.miclaus@analog.com> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-ORIG-GUID: v8yQB1dpA9xOJpSBWzmxGpHZZhgCOWwc X-Proofpoint-GUID: v8yQB1dpA9xOJpSBWzmxGpHZZhgCOWwc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-09-02_01,2024-08-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 impostorscore=0 clxscore=1015 suspectscore=0 adultscore=0 phishscore=0 mlxscore=0 lowpriorityscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2409020068 Add devicetree support within the driver. Make the old platform data approach optional. Signed-off-by: Antoniu Miclaus --- new in v2. drivers/input/touchscreen/ad7877.c | 68 +++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c index 7886454a19c6..3fa38043b561 100644 --- a/drivers/input/touchscreen/ad7877.c +++ b/drivers/input/touchscreen/ad7877.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -667,6 +668,68 @@ static void ad7877_setup_ts_def_msg(struct spi_device *spi, struct ad7877 *ts) } } +static struct ad7877_platform_data *ad7877_parse_props(struct device *dev) +{ + struct ad7877_platform_data *pdata; + u32 value, average; + + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) + return ERR_PTR(-ENOMEM); + + pdata->model = (uintptr_t)device_get_match_data(dev); + + device_property_read_u8(dev, "adi,stopacq-polarity", + &pdata->stopacq_polarity); + device_property_read_u8(dev, "adi,first-conv-delay", + &pdata->first_conversion_delay); + device_property_read_u8(dev, "adi,pen-down-acc-interval", + &pdata->pen_down_acc_interval); + device_property_read_u8(dev, "adi,acquisition-time", + &pdata->acquisition_time); + + device_property_read_u16(dev, "adi,vref-delay-usecs", + &pdata->vref_delay_usecs); + + device_property_read_u32(dev, "touchscreen-x-plate-ohms", &value); + pdata->x_plate_ohms = (u16)value; + device_property_read_u32(dev, "touchscreen-y-plate-ohms", &value); + pdata->y_plate_ohms = (u16)value; + device_property_read_u32(dev, "touchscreen-min-x", &value); + pdata->x_min = (u16)value; + device_property_read_u32(dev, "touchscreen-min-y", &value); + pdata->y_min = (u16)value; + device_property_read_u32(dev, "touchscreen-max-x", &value); + pdata->x_max = (u16)value; + device_property_read_u32(dev, "touchscreen-max-y", &value); + pdata->y_max = (u16)value; + device_property_read_u32(dev, "touchscreen-max-pressure", &value); + pdata->pressure_max = (u16)value; + device_property_read_u32(dev, "touchscreen-min-pressure", &value); + pdata->pressure_min = (u16)value; + device_property_read_u32(dev, "touchscreen-average-samples", &average); + switch (average) { + case 1: + pdata->averaging = 0; + break; + case 4: + pdata->averaging = 1; + break; + case 8: + pdata->averaging = 2; + break; + case 16: + pdata->averaging = 3; + break; + default: + dev_err(dev, + "touchscreen-average-samples must be 1, 4, 8, or 16\n"); + return ERR_PTR(-EINVAL); + } + + return pdata; +} + static int ad7877_probe(struct spi_device *spi) { struct ad7877 *ts; @@ -681,8 +744,9 @@ static int ad7877_probe(struct spi_device *spi) } if (!pdata) { - dev_dbg(&spi->dev, "no platform data?\n"); - return -ENODEV; + pdata = ad7877_parse_props(&spi->dev); + if (IS_ERR(pdata)) + return PTR_ERR(pdata); } /* don't exceed max specified SPI CLK frequency */ From patchwork Mon Sep 2 08:24:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antoniu Miclaus X-Patchwork-Id: 13786913 Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29296185B52; Mon, 2 Sep 2024 08:28:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.135.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725265697; cv=none; b=iyEN6DxB7tZEPhoZS6YggG9wb2F4WIh/iacMVZJKcIz1jT7s/pEZ8IiI6/2adbrx8SsE1dOpzDdkbM1fi1Vgti3m9bSiMLXjDSs0TJ7NFGk7U9bq+ndTeq6y9ZoAgBwbVRMl1eCz6/jCQTMBR5SSdyFfpZbGR9KCwhA5bUBgUvE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725265697; c=relaxed/simple; bh=JTGXCPQV1SXGDQLLqnNtwYuJsMTwPZ/BFJno9CJLK2E=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=G9kn1q08RhnvBLSERoujM/i0T6Sqt3r54v1bd3X+5DTzUVOFSGVsf2DcOo1cwjI8TrrAiAqq5iC6kgIuUal3wJtrNBMHOzXVnzbcalEnkPM1mfSXuz1e/1dN60rgi2ugHdQ2O1wK9vZ2qBYdzgbYdn9xoZ/shp0zEbY2vG1rj/I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com; spf=pass smtp.mailfrom=analog.com; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=Ax9psk69; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="Ax9psk69" Received: from pps.filterd (m0167088.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48238Gfx014371; Mon, 2 Sep 2024 04:28:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=DKIM; bh=WgkV6 53C7pjxd2xTEAb72p4RtTDQX5Aehp2L9UtlQhI=; b=Ax9psk694wSVFBcyb+a8x dYk3rbgtR92k++keuuhWv/oBUQqjLGVDx7c/+14TGMK4mDYRtIHYlahcgdB6NdRM wpk+xM3pBgfdr7RTX7jLw4BQM6t7r4Um6rbnUbN+t/zTCAYk1eY/SPDeC0tDR4sI OCaDsco5+jQDGdFwozxdfRqy58jZkTJoKMNjTQw1dm4wRzTKXEz1t/iBtKd+Now0 nHwrL/UG3/oWnyTauQOg10BBnDfkl9gPySrhB62FilfuRptuZyBYQM96vp+Wwjjm hNa7LCXPqHXBDqfoowcLmBEx8gvNNfBzdEEdmseYr/lfoaCBkk3DWJ+9PpZ+SUv2 g== Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 41bw13phn9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 02 Sep 2024 04:28:12 -0400 (EDT) Received: from ASHBMBX8.ad.analog.com (ASHBMBX8.ad.analog.com [10.64.17.5]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 4828SBGv022765 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 2 Sep 2024 04:28:11 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Mon, 2 Sep 2024 04:28:10 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Mon, 2 Sep 2024 04:28:10 -0400 Received: from amiclaus-VirtualBox.ad.analog.com (AMICLAUS-L02.ad.analog.com [10.48.65.139]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 4828R9oS014033; Mon, 2 Sep 2024 04:28:01 -0400 From: Antoniu Miclaus To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Hennerich , Antoniu Miclaus , , , Subject: [PATCH v2 3/3] dt-bindings: touchscreen: ad7877: add bindings Date: Mon, 2 Sep 2024 11:24:33 +0300 Message-ID: <20240902082707.4325-3-antoniu.miclaus@analog.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240902082707.4325-1-antoniu.miclaus@analog.com> References: <20240902082707.4325-1-antoniu.miclaus@analog.com> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-ORIG-GUID: 1_ey-6oR9a9f6QrL3vaxWP3feygB1g7M X-Proofpoint-GUID: 1_ey-6oR9a9f6QrL3vaxWP3feygB1g7M X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-09-02_01,2024-08-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 impostorscore=0 clxscore=1015 priorityscore=1501 adultscore=0 malwarescore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 lowpriorityscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2409020069 Add device tree bindings for the ad7877 driver. Signed-off-by: Antoniu Miclaus --- changes in v2: - add only the used properties from touchscreen.yaml - add vendor properties. - update dt example. .../input/touchscreen/adi,ad7877.yaml | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/touchscreen/adi,ad7877.yaml diff --git a/Documentation/devicetree/bindings/input/touchscreen/adi,ad7877.yaml b/Documentation/devicetree/bindings/input/touchscreen/adi,ad7877.yaml new file mode 100644 index 000000000000..035e2d5bbcb8 --- /dev/null +++ b/Documentation/devicetree/bindings/input/touchscreen/adi,ad7877.yaml @@ -0,0 +1,110 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/touchscreen/adi,ad7877.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Analog Devices AD7877 Touch Screen Controller + +maintainers: + - Antoniu Miclaus + +description: | + Analog Devices Touch Screen Controller + https://www.analog.com/media/en/technical-documentation/data-sheets/AD7877.pdf + +allOf: + - $ref: touchscreen.yaml# + - $ref: /schemas/spi/spi-peripheral-props.yaml# + +properties: + compatible: + enum: + - adi,ad7877 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + spi-max-frequency: + description: AD7877 SPI bus clock frequency. + minimum: 10000 + maximum: 20000000 + + adi,stopacq-polarity: + description: The polarity of the signal applied to the STOPACQ pin. + 0 = active low + 1 = active high + $ref: /schemas/types.yaml#/definitions/uint8 + enum: [0, 1] + + adi,first-conv-delay: + description: Delay before the first conversion. + 0 = 0.5us + 1 = 128us + 2 = 1ms + 3 = 8ms + $ref: /schemas/types.yaml#/definitions/uint8 + enum: [0, 1, 2, 3] + + adi,pen-down-acc-interval: + description: Enable the ADC to repeatedly perform conversions. + 0 = covert once + 1 = every 0.5 ms + 2 = every 1 ms + 3 = every 8 ms + $ref: /schemas/types.yaml#/definitions/uint8 + enum: [0, 1, 2, 3] + + adi,acquisition-time: + description: Select acquisition times for the ADC. + 0 = 2us + 1 = 4us + 2 = 8us + 3 = 16us + $ref: /schemas/types.yaml#/definitions/uint8 + enum: [0, 1, 2, 3] + + adi,vref-delay-usecs: + description: Delay required for the SPI transfers depending on the VREF used. + $ref: /schemas/types.yaml#/definitions/uint16 + + touchscreen-average-samples: + enum: [1, 4, 8, 16] + + touchscreen-x-plate-ohms: true + touchscreen-y-plate-ohms: true + touchscreen-min-x: true + touchscreen-min-y: true + touchscreen-max-x: true + touchscreen-max-y: true + touchscreen-max-pressure: true + touchscreen-min-pressure: true + +required: + - compatible + - reg + - interrupts + - touchscreen-average-samples + +additionalProperties: false + +examples: + - | + #include + spi { + #address-cells = <1>; + #size-cells = <0>; + + touchscreen@0 { + compatible = "adi,ad7877"; + reg = <0>; + spi-max-frequency = <20000000>; + interrupts = <21 IRQ_TYPE_EDGE_FALLING>; + interrupt-parent = <&gpio>; + touchscreen-average-samples = <16>; + }; + }; +...