Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1632999ybh; Thu, 23 Jul 2020 13:58:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVXoYA8Lq+A+o4eqVDLghU25KGFgTSMdsbBQocICLJwNN0hyYd2G0jDbpckeeotDkAfCg/ X-Received: by 2002:a17:906:414c:: with SMTP id l12mr6401327ejk.417.1595537885910; Thu, 23 Jul 2020 13:58:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595537885; cv=none; d=google.com; s=arc-20160816; b=mTKoyvuD5BQfU5SRbBNBdnst0G+avZFRnOnkZ8tvMC7EfmbMpisSfffLzQp7cq7am1 UN7JJxVNeVNNFXLJCOT6H3ZxrT0aNxfN7PU31G3MLNZhJNp23Sjph5BzXWLDdjm2C0jH 2SFaYoQnGjMBL8UirtOSxAgfaQ0HCAvwgNptfmGh2iAN4THrAFB/BvdlIiGUk3sBQMce XUrvftxkXiFsxxjGjXyawggmUYP73VWYEs7i3qSKF61bdOZ9dfT+H4tOSNyJ946qy9MD xLME5yQO8qjVQGn0CbdLUsCkxm4D1Q8e/ES53ENcCUbyv1tv3ZxVAl2OZTM23+TXDi8n iMwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=ICBX86+Lkkci6Ue+B7VowL4TPQylTLlU+8rjSgsn/kY=; b=K8PpzrU9fTbquh4A1SHAQrqRTWP4IndudUJc5us9huS6zUKu35ffdWB+vIh04mTL7W XoFzaMQbBv85EkQeRZmlci79PUoHRdoLAYMmRg+VjMnnNSI3JF1hpE0NgcoYaJIQEuXt MbDjSClSvzN7+I9fbUtXlq/TCErEBmHdzwm09Z8Y0xwJjp2NH9vZ/Tvv0tNMA2fp3TSZ AmtresK0nefW6XlnvOx7wut5suAqmo2jLmvU5q+6WUvQGQX7eak5r7o+0ILnybkvTutD 6k7P4nUQIlPHKe6uTaYlzCkrMbC1keoRDnDgCoJg40LFzYL9UBw3SXhaH23i8mlAeDeI ZKsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=PXTfv7AN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx25si2563505edb.75.2020.07.23.13.57.43; Thu, 23 Jul 2020 13:58:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=PXTfv7AN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728217AbgGWUzL (ORCPT + 99 others); Thu, 23 Jul 2020 16:55:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726063AbgGWUzK (ORCPT ); Thu, 23 Jul 2020 16:55:10 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD423C0619D3; Thu, 23 Jul 2020 13:55:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description; bh=ICBX86+Lkkci6Ue+B7VowL4TPQylTLlU+8rjSgsn/kY=; b=PXTfv7ANvy94gKr5OC2zsWn/nz i3vfvhKgL0r99ZON2G7T9JuyG6hp+D7SaO4uHupQV/jZRDdUs3jiKiALhhPXE9kOvbSJOOHRtFRj2 WA1dy4PcFiEgIpjkKiTwq8X3A4Ob09hCWySRByy+HGaFBHhhzefDJRLOXjMdVulhuFAIhwqRTwA6L 0oZDBTtSmj0lU2JewPsGFRLexOeKXW7RKsoyiWTGFMmEVkM/vxwYDhL36tMUDXFSHy4A5dy41IcQS 5EYweiIy2x8N85dmapjSvH7QoSjE/icilxuyiZQhmJDdrlCrs7tzavF85LR4SX7dMqcBBXxQBtojP /cVSq9cg==; Received: from [2601:1c0:6280:3f0::19c2] by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyiF9-00043b-9A; Thu, 23 Jul 2020 20:55:08 +0000 Subject: Re: [PATCH V17 3/3] Input: new da7280 haptic driver To: Roy Im , Uwe Kleine-Koenig , Bartosz Golaszewski , Brian Masney , Dmitry Torokhov , Greg KH , Lee Jones , Luca Weiss , Maximilian Luz , Pascal PAILLET-LME , Rob Herring , Samuel Ortiz , Thierry Reding , Thomas Gleixner Cc: Support Opensource , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org References: From: Randy Dunlap Message-ID: Date: Thu, 23 Jul 2020 13:55:02 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/23/20 8:01 AM, Roy Im wrote: > Adds support for the Dialog DA7280 LRA/ERM Haptic Driver with > multiple mode and integrated waveform memory and wideband support. > It communicates via an I2C bus to the device. > > Reviewed-by: Jes Sorensen . > > Signed-off-by: Roy Im > > --- > > > drivers/input/misc/Kconfig | 13 + > drivers/input/misc/Makefile | 1 + > drivers/input/misc/da7280.c | 1840 +++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 1854 insertions(+) > create mode 100644 drivers/input/misc/da7280.c > > diff --git a/drivers/input/misc/da7280.c b/drivers/input/misc/da7280.c > new file mode 100644 > index 0000000..6e3ead5 > --- /dev/null > +++ b/drivers/input/misc/da7280.c > @@ -0,0 +1,1840 @@ > +// SPDX-License-Identifier: GPL-2.0+ > +/* > + * DA7280 Haptic device driver > + * > + * Copyright (c) 2020 Dialog Semiconductor. > + * Author: Roy Im > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + ... > +static int da7280_haptic_set_pwm(struct da7280_haptic *haptics, bool enabled) > +{ > + struct pwm_state state; > + u64 period_mag_multi; > + int error; > + > + if (!haptics->gain && enabled) { > + dev_err(haptics->dev, > + "Please set the gain first for the pwm mode\n"); > + return -EINVAL; > + } > + > + pwm_get_state(haptics->pwm_dev, &state); > + state.enabled = enabled; > + if (enabled) { > + period_mag_multi = (u64)state.period * haptics->gain; > + period_mag_multi >>= MAX_MAGNITUDE_SHIFT; > + > + /* The interpretation of duty cycle depends on the acc_en, > + * it should be between 50% and 100% for acc_en = 0. > + * See datasheet 'PWM mode' section. > + */ from coding-style.rst: /* * This is the preferred style for multi-line * comments in the Linux kernel source code. * Please use it consistently. * * Description: A column of asterisks on the left side, * with beginning and ending almost-blank lines. */ (except for networking code) Please fix multiple locations. thanks. -- ~Randy