Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751703AbbGaBpx (ORCPT ); Thu, 30 Jul 2015 21:45:53 -0400 Received: from mail-bl2on0136.outbound.protection.outlook.com ([65.55.169.136]:21424 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751000AbbGaBpu convert rfc822-to-8bit (ORCPT ); Thu, 30 Jul 2015 21:45:50 -0400 From: Dudley Du To: Dmitry Torokhov CC: "mark.rutland@arm.com" , "robh+dt@kernel.org" , "bleung@google.com" , "jmmahler@gmail.com" , "devicetree@vger.kernel.org" , "linux-input@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 1/3] input: cyapa: add regulator vcc support Thread-Topic: [PATCH 1/3] input: cyapa: add regulator vcc support Thread-Index: AQHQxc6MIUx1MdiZt0KQ2B33hIRyDZ30YLmAgAB3aiA= Date: Fri, 31 Jul 2015 01:45:46 +0000 Message-ID: References: <1437714359-2484-1-git-send-email-dudl@cypress.com> <1437714359-2484-2-git-send-email-dudl@cypress.com> <20150730183303.GH13165@dtor-ws> In-Reply-To: <20150730183303.GH13165@dtor-ws> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none; x-originating-ip: [157.95.211.187] x-microsoft-exchange-diagnostics: 1;CY1PR06MB1819;5:jpZJyj7ihTtJPoR8Kn9boiX7UpwjzAiRNxQoZ76M78e0C666yCmKtR73FHM4lyJVeTvTZhPMGKQd/dDFV0H/DUkNLtC4piBkgNKhwnFk9/XYsTsanTNbeBkrpXcj/sq3SYmQ1lTiPHpK/PoBifSGPw==;24:ehCS699Z3LelCfZ1PuBeKX9cMjBW0P7La3DduIWfuIR0gzxM9lyYyACoXA2CbPX1EIb9wwBemLu+UaEzPpHY/90Lvx7hfHGLmOR6Uqw4RSQ=;20:qeERM5c9R+zET0RMkJX3rHWRwDp3dAZNFgfPv25sT5jbENVRZtIwR20J3hiah4d/ueuGg/CuU1szU8peikvfDg== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR06MB1819; x-loop: 1 cy1pr06mb1819: X-MS-Exchange-Organization-RulesExecuted x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:CY1PR06MB1819;BCL:0;PCL:0;RULEID:;SRVR:CY1PR06MB1819; x-forefront-prvs: 0654257CF5 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(13464003)(51164003)(24454002)(164054003)(189998001)(19580395003)(5003600100002)(86362001)(106116001)(33656002)(2656002)(46102003)(87936001)(19580405001)(66066001)(54356999)(50986999)(122556002)(5002640100001)(62966003)(77096005)(2950100001)(76576001)(74316001)(76176999)(110136002)(99286002)(5001920100001)(40100003)(5890100001)(77156002)(92566002)(2900100001)(5001960100002)(102836002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR06MB1819;H:CY1PR06MB1817.namprd06.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jul 2015 01:45:46.8902 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR06MB1819 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3723 Lines: 111 Dmitry, Thank your very much. Thanks, Dudley > -----Original Message----- > From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com] > Sent: 2015?7?31? 2:33 > To: Dudley Du > Cc: mark.rutland@arm.com; robh+dt@kernel.org; bleung@google.com; > jmmahler@gmail.com; devicetree@vger.kernel.org; linux-input@vger.kernel.org; > linux-kernel@vger.kernel.org > Subject: Re: [PATCH 1/3] input: cyapa: add regulator vcc support > > On Fri, Jul 24, 2015 at 01:05:57PM +0800, Dudley Du wrote: > > Add power management regulator vcc support. > > It's described to be supported in the cypress,cyapa.txt document. > > > > Signed-off-by: Dudley Du > > It looks like we were missing linux/regulator/consumer.h include, I > added it and applied. > > Thanks. > > > --- > > drivers/input/mouse/cyapa.c | 28 ++++++++++++++++++++++++++++ > > drivers/input/mouse/cyapa.h | 1 + > > 2 files changed, 29 insertions(+) > > > > diff --git a/drivers/input/mouse/cyapa.c b/drivers/input/mouse/cyapa.c > > index 6195ccb..2159c5e 100644 > > --- a/drivers/input/mouse/cyapa.c > > +++ b/drivers/input/mouse/cyapa.c > > @@ -1241,6 +1241,13 @@ static void cyapa_remove_sysfs_group(void *data) > > sysfs_remove_group(&cyapa->client->dev.kobj, &cyapa_sysfs_group); > > } > > > > +static void cyapa_disable_regulator(void *data) > > +{ > > +struct cyapa *cyapa = data; > > + > > +regulator_disable(cyapa->vcc); > > +} > > + > > static int cyapa_probe(struct i2c_client *client, > > const struct i2c_device_id *dev_id) > > { > > @@ -1274,6 +1281,27 @@ static int cyapa_probe(struct i2c_client *client, > > sprintf(cyapa->phys, "i2c-%d-%04x/input0", client->adapter->nr, > > client->addr); > > > > +cyapa->vcc = devm_regulator_get(dev, "vcc"); > > +if (IS_ERR(cyapa->vcc)) { > > +error = PTR_ERR(cyapa->vcc); > > +dev_err(dev, "failed to get vcc regulator: %d\n", error); > > +return error; > > +} > > + > > +error = regulator_enable(cyapa->vcc); > > +if (error) { > > +dev_err(dev, "failed to enable regulator: %d\n", error); > > +return error; > > +} > > + > > +error = devm_add_action(dev, cyapa_disable_regulator, cyapa); > > +if (error) { > > +cyapa_disable_regulator(cyapa); > > +dev_err(dev, "failed to add disable regulator action: %d\n", > > +error); > > +return error; > > +} > > + > > error = cyapa_initialize(cyapa); > > if (error) { > > dev_err(dev, "failed to detect and initialize tp device.\n"); > > diff --git a/drivers/input/mouse/cyapa.h b/drivers/input/mouse/cyapa.h > > index af12536..b812bba 100644 > > --- a/drivers/input/mouse/cyapa.h > > +++ b/drivers/input/mouse/cyapa.h > > @@ -321,6 +321,7 @@ struct cyapa { > > u8 status[BL_STATUS_SIZE]; > > bool operational; /* true: ready for data reporting; false: not. */ > > > > +struct regulator *vcc; > > struct i2c_client *client; > > struct input_dev *input; > > char phys[32];/* Device physical location */ > > -- > > 1.9.1 > > > > > > --------------------------------------------------------------- > > This message and any attachments may contain Cypress (or its > > subsidiaries) confidential information. If it has been received > > in error, please advise the sender and immediately delete this > > message. > > --------------------------------------------------------------- > > > > -- > Dmitry This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/