From patchwork Thu Feb 16 17:35:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Fitzgerald X-Patchwork-Id: 9577791 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6DC3460209 for ; Thu, 16 Feb 2017 17:36:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 605E32862C for ; Thu, 16 Feb 2017 17:36:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 54E1128653; Thu, 16 Feb 2017 17:36:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 311D52862C for ; Thu, 16 Feb 2017 17:36:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932674AbdBPRgh (ORCPT ); Thu, 16 Feb 2017 12:36:37 -0500 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:56973 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932465AbdBPRgg (ORCPT ); Thu, 16 Feb 2017 12:36:36 -0500 Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1GHYL1p016107; Thu, 16 Feb 2017 11:36:22 -0600 Authentication-Results: ppops.net; spf=none smtp.mailfrom=rf@opensource.wolfsonmicro.com Received: from mail2.cirrus.com (mail1.cirrus.com [141.131.3.20]) by mx0b-001ae601.pphosted.com with ESMTP id 28hywqffrg-1; Thu, 16 Feb 2017 11:36:21 -0600 Received: from EX17.ad.cirrus.com (unknown [172.20.9.81]) by mail2.cirrus.com (Postfix) with ESMTP id 300AE6121AD5; Thu, 16 Feb 2017 11:36:21 -0600 (CST) Received: from imbe.wolfsonmicro.main (198.61.95.81) by EX17.ad.cirrus.com (172.20.9.81) with Microsoft SMTP Server id 14.3.301.0; Thu, 16 Feb 2017 17:35:59 +0000 Received: from rf-debian.wolfsonmicro.main ([172.22.20.124]) by imbe.wolfsonmicro.main (8.14.4/8.14.4) with ESMTP id v1GHZYdH016339; Thu, 16 Feb 2017 17:35:34 GMT From: Richard Fitzgerald To: , CC: , , , Subject: [PATCH] input: arizona-haptics - Add device property for HAP_ACT Date: Thu, 16 Feb 2017 17:35:58 +0000 Message-ID: <1487266558-19040-1-git-send-email-rf@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702160165 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This adds a device property for setting the configuration for the HAP_ACT register field so that the connected actuator type can be configured on systems that are not using pdata. Signed-off-by: Richard Fitzgerald --- Documentation/devicetree/bindings/input/arizona-haptics.txt | 10 ++++++++++ MAINTAINERS | 1 + drivers/input/misc/arizona-haptics.c | 7 +++++++ 3 files changed, 18 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/arizona-haptics.txt diff --git a/Documentation/devicetree/bindings/input/arizona-haptics.txt b/Documentation/devicetree/bindings/input/arizona-haptics.txt new file mode 100644 index 0000000..a3e767b --- /dev/null +++ b/Documentation/devicetree/bindings/input/arizona-haptics.txt @@ -0,0 +1,10 @@ +Cirrus Logic Arizona class audio SoCs + +This document lists haptics bindings for these codecs. +Also see the primary binding document: + ../mfd/arizona.txt + +Optional properties: + - wlf,hap-act : Single value defining the actuator type, as per the HAP_ACT + register field. See the codec datasheet for the available HAP_ACT values + and their meaning. diff --git a/MAINTAINERS b/MAINTAINERS index 26edd83..be4ea3e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13377,6 +13377,7 @@ W: https://github.com/CirrusLogic/linux-drivers/wiki S: Supported F: Documentation/hwmon/wm83?? F: Documentation/devicetree/bindings/extcon/extcon-arizona.txt +F: Documentation/devicetree/bindings/input/arizona*.txt F: Documentation/devicetree/bindings/regulator/arizona-regulator.txt F: Documentation/devicetree/bindings/mfd/arizona.txt F: arch/arm/mach-s3c64xx/mach-crag6410* diff --git a/drivers/input/misc/arizona-haptics.c b/drivers/input/misc/arizona-haptics.c index 21dc1b8..0264d95 100644 --- a/drivers/input/misc/arizona-haptics.c +++ b/drivers/input/misc/arizona-haptics.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -164,6 +165,12 @@ static int arizona_haptics_probe(struct platform_device *pdev) haptics->arizona = arizona; + if (!dev_get_platdata(arizona->dev)) + device_property_read_u32(arizona->dev, "wlf,hap-act", + &arizona->pdata.hap_act); + + dev_dbg(arizona->dev, "hap_act=%u\n", arizona->pdata.hap_act); + ret = regmap_update_bits(arizona->regmap, ARIZONA_HAPTICS_CONTROL_1, ARIZONA_HAP_ACT, arizona->pdata.hap_act); if (ret != 0) {