lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue, 15 Nov 2011 07:50:43 +0100
From:	<oskar.andero@...yericsson.com>
To:	Shubhrajyoti Datta <omaplinuxkernel@...il.com>
CC:	"dmitry.torokhov@...il.com" <dmitry.torokhov@...il.com>,
	"linux-input@...r.kernel.org" <linux-input@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"jic23@....ac.uk" <jic23@....ac.uk>,
	"aghayal@...eaurora.org" <aghayal@...eaurora.org>,
	"Cavin, Courtney" <Courtney.Cavin@...yericsson.com>
Subject: Re: [PATCH v2] input: add driver support for Sharp gp2ap002a00f
 proximity sensor

Hi Shubhrajyoti,

Thanks for reviewing!

On 17:52 Mon 14 Nov     , Shubhrajyoti Datta wrote:
>    Hi Courtney,
>    Some minor comments
> 
>    On Mon, Nov 14, 2011 at 9:09 PM, <[1]oskar.andero@...yericsson.com>
>    wrote:
> 
>      From: Courtney Cavin <[2]courtney.cavin@...yericsson.com>
>      Signed-off-by: Courtney Cavin <[3]courtney.cavin@...yericsson.com>
>      Signed-off-by: Oskar Andero <[4]oskar.andero@...yericsson.com>
>      ---
>       drivers/input/misc/Kconfig         |   11 ++
>       drivers/input/misc/Makefile        |    1 +
>       drivers/input/misc/gp2ap002a00f.c  |  286
>      ++++++++++++++++++++++++++++++++++++
>       include/linux/input/gp2ap002a00f.h |   22 +++
>       4 files changed, 320 insertions(+), 0 deletions(-)
>       create mode 100644 drivers/input/misc/gp2ap002a00f.c
>       create mode 100644 include/linux/input/gp2ap002a00f.h
>      diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
>      index 22d875f..dee96a0 100644
>      --- a/drivers/input/misc/Kconfig
>      +++ b/drivers/input/misc/Kconfig
>      @@ -544,4 +544,15 @@ config INPUT_XEN_KBDDEV_FRONTEND
>               To compile this driver as a module, choose M here: the
>               module will be called xen-kbdfront.
>      +config INPUT_GP2A
>      +       tristate "Sharp GP2AP002A00F I2C Proximity/Opto sensor
>      driver"
>      +       depends on I2C
>      +       default n
> 
>    you may want to drop it as default is anyways n.
> 
>      +       help
>      +         Say Y here if you have a Sharp GP2AP002A00F proximity/als
>      combo-chip
>      +         hooked to an I2C bus.
>      +
>      +         To compile this driver as a module, choose M here: the
>      +         module will be called gp2ap002a00f.
>      +
>       endif
>      diff --git a/drivers/input/misc/Makefile
>      b/drivers/input/misc/Makefile
>      index a244fc6..1681993 100644
>      --- a/drivers/input/misc/Makefile
>      +++ b/drivers/input/misc/Makefile
>      @@ -22,6 +22,7 @@ obj-$(CONFIG_INPUT_CMA3000)           +=
>      cma3000_d0x.o
>       obj-$(CONFIG_INPUT_CMA3000_I2C)                += cma3000_d0x_i2c.o
>       obj-$(CONFIG_INPUT_COBALT_BTNS)                += cobalt_btns.o
>       obj-$(CONFIG_INPUT_DM355EVM)           += dm355evm_keys.o
>      +obj-$(CONFIG_INPUT_GP2A)               += gp2ap002a00f.o
>       obj-$(CONFIG_HP_SDC_RTC)               += hp_sdc_rtc.o
>       obj-$(CONFIG_INPUT_IXP4XX_BEEPER)      += ixp4xx-beeper.o
>       obj-$(CONFIG_INPUT_KEYSPAN_REMOTE)     += keyspan_remote.o
>      diff --git a/drivers/input/misc/gp2ap002a00f.c
>      b/drivers/input/misc/gp2ap002a00f.c
>      new file mode 100644
>      index 0000000..1c5ddf8
>      --- /dev/null
>      +++ b/drivers/input/misc/gp2ap002a00f.c
>      @@ -0,0 +1,286 @@
>      +/*
>      + * Copyright (C) 2009,2010 Sony Ericsson Mobile Communications Inc.
> 
>    May want to check the year.
> 
>      + *
>      + * Author: Courtney Cavin <[5]courtney.cavin@...yericsson.com>
>      + * Prepared for up-stream by: Oskar Andero
>      <[6]oskar.andero@...yericsson.com>
> 
>      + *
>      + * This program is free software; you can redistribute it and/or
>      modify
>      + * it under the terms of the GNU General Public License version 2,
>      as
>      + * published by the Free Software Foundation.
>      + */
>      +
>      +#include <linux/i2c.h>
>      +#include <linux/irq.h>
>      +#include <linux/slab.h>
>      +#include <linux/input.h>
>      +#include <linux/module.h>
>      +#include <linux/workqueue.h>
> 
>    Are all these header files needed?
> 
>      +#include <linux/interrupt.h>
>      +#include <linux/gpio.h>
>      +#include <linux/delay.h>
>      +#include <linux/input/gp2ap002a00f.h>
>      +
>      +struct gp2a_data {
>      +       struct input_dev *device;
>      +       const struct gp2a_platform_data *pdata;
>      +       struct i2c_client *i2c_client;
>      +};
>      +
>      +enum gp2a_addr {
>      +       GP2A_ADDR_PROX  = 0x0,
>      +       GP2A_ADDR_GAIN  = 0x1,
>      +       GP2A_ADDR_HYS   = 0x2,
>      +       GP2A_ADDR_CYCLE = 0x3,
>      +       GP2A_ADDR_OPMOD = 0x4,
>      +       GP2A_ADDR_CON   = 0x6
>      +};
>      +
>      +enum gp2a_controls {
>      +       GP2A_CTRL_SSD   = 0x01
> 
>    Not a comment really
>    Could you explain SSD?

SSD means Software shutdown according to the datasheet where 0 puts the
chip in shutdown and 1 in normal operation. I'll add a comment in the code.

-Oskar
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ