linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trilok Soni <soni.trilok@gmail.com>
To: Joonyoung Shim <jy0922.shim@samsung.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	kmpark@infradead.org, dg77.kim@samsung.com
Subject: Re: [PATCH] HAPTIC: add HAPTIC class
Date: Mon, 14 Sep 2009 16:05:52 +0530	[thread overview]
Message-ID: <5d5443650909140335h6a81c684h2846c5365e144425@mail.gmail.com> (raw)
In-Reply-To: <4AA62BFF.2050703@samsung.com>

Hi Kyungmin Park,

> +
> +static ssize_t haptic_value_store(struct device *dev,
> +               struct device_attribute *attr, const char *buf, size_t size)
> +{
> +       struct haptic_classdev *haptic_cdev = dev_get_drvdata(dev);
> +       ssize_t ret = -EINVAL;
> +       char *after;
> +       unsigned long state = simple_strtoul(buf, &after, 10);

s/simple_strtoul/strict_strtoul. code looks clean, but let's scan it
through scripts/checkpatch.pl.

> diff --git a/drivers/haptic/haptic.h b/drivers/haptic/haptic.h
> new file mode 100644
> index 0000000..888aaa3
> --- /dev/null
> +++ b/drivers/haptic/haptic.h
> @@ -0,0 +1,35 @@
> +/*
> + *  Haptic Core
> + *
> + *  Copyright (C) 2008 Samsung Electronics
> + *  Kyungmin Park <kyungmin.park@samsung.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.
> + *
> + */
> +
> +#ifndef __HAPTIC_H_INCLUDED
> +#define __HAPTIC_H_INCLUDED
> +
> +#include <linux/device.h>
> +#include <linux/rwsem.h>
> +#include <linux/haptic.h>
> +
> +static inline void haptic_set_value(struct haptic_classdev *haptic_cdev,
> +                                       enum haptic_value value)
> +{
> +       if (value > HAPTIC_FULL)
> +               value = HAPTIC_FULL;
> +       haptic_cdev->value = value;
> +       if (!(haptic_cdev->flags & HAPTIC_SUSPENDED))
> +               haptic_cdev->set(haptic_cdev, value);
> +}
> +
> +static inline int haptic_get_value(struct haptic_classdev *haptic_cdev)
> +{
> +       return haptic_cdev->value;
> +}

You had mentioned in Kconfig help text that haptics set/get APIs can
be accessed from kernel drivers too, I am not able to understand that
from this code.


-- 
---Trilok Soni
http://triloksoni.wordpress.com
http://www.linkedin.com/in/triloksoni

      parent reply	other threads:[~2009-09-14 10:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-08 10:03 [PATCH] HAPTIC: add HAPTIC class Joonyoung Shim
2009-09-08 15:36 ` Trilok Soni
2009-09-14 10:35 ` Trilok Soni [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5d5443650909140335h6a81c684h2846c5365e144425@mail.gmail.com \
    --to=soni.trilok@gmail.com \
    --cc=dg77.kim@samsung.com \
    --cc=jy0922.shim@samsung.com \
    --cc=kmpark@infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).