From: Kalle Valo <kvalo@codeaurora.org>
To: Maya Erez <qca_merez@qca.qualcomm.com>
Cc: linux-wireless@vger.kernel.org, wil6210@qca.qualcomm.com
Subject: Re: [PATCH v2 7/7] wil6210: add support for device led configuration
Date: Mon, 25 Apr 2016 21:56:39 +0300 [thread overview]
Message-ID: <87a8kh1pqw.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <1461589078-29854-8-git-send-email-qca_merez@qca.qualcomm.com> (Maya Erez's message of "Mon, 25 Apr 2016 15:57:58 +0300")
Maya Erez <qca_merez@qca.qualcomm.com> writes:
> Add the ability to configure the device led to be used for notifying
> the AP activity (60G device supports leds 0-2).
> The host can also configure the blinking frequency of the led in
> three states.
[...]
> +/* led_blink_time, write:
> + * "<blink_on_slow> <blink_off_slow> <blink_on_med> <blink_off_med> <blink_on_fast> <blink_off_fast>
> + */
> +static ssize_t wil_write_led_blink_time(struct file *file,
> + const char __user *buf,
> + size_t len, loff_t *ppos)
> +{
> + int rc;
> + char *kbuf = kmalloc(len + 1, GFP_KERNEL);
> +
> + if (!kbuf)
> + return -ENOMEM;
> +
> + rc = simple_write_to_buffer(kbuf, len, ppos, buf, len);
> + if (rc != len) {
> + kfree(kbuf);
> + return rc >= 0 ? -EIO : rc;
> + }
> +
> + kbuf[len] = '\0';
> + rc = sscanf(kbuf, "%d %d %d %d %d %d",
> + &led_blink_time[WIL_LED_TIME_SLOW].on_ms,
> + &led_blink_time[WIL_LED_TIME_SLOW].off_ms,
> + &led_blink_time[WIL_LED_TIME_MED].on_ms,
> + &led_blink_time[WIL_LED_TIME_MED].off_ms,
> + &led_blink_time[WIL_LED_TIME_FAST].on_ms,
> + &led_blink_time[WIL_LED_TIME_FAST].off_ms);
> + kfree(kbuf);
> +
> + if (rc < 0)
> + return rc;
> + if (rc < 6)
> + return -EINVAL;
> +
> + return len;
> +}
Don't we already have a proper framework for leds? At least
include/linux/led.h and drivers/led/ makes me suspect that. I'm not
really fond of the idea reinventing the wheel, unless there's a really
good reason.
--
Kalle Valo
next prev parent reply other threads:[~2016-04-25 18:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-25 12:57 [PATCH v2 0/7] wil6210 patches Maya Erez
2016-04-25 12:57 ` [PATCH v2 1/7] wil6210: add function name to wil log macros Maya Erez
2016-04-25 12:57 ` [PATCH v2 2/7] wil6210: support regular scan on P2P_DEVICE interface Maya Erez
2016-04-25 12:57 ` [PATCH v2 3/7] wil6210: change RX_HTRSH interrupt print level to debug Maya Erez
2016-04-25 12:57 ` [PATCH v2 4/7] wil6210: print debug message when transmitting while disconnected Maya Erez
2016-04-25 12:57 ` [PATCH v2 5/7] wil6210: unmask RX_HTRSH interrupt only when connected Maya Erez
2016-04-25 12:57 ` [PATCH v2 6/7] wil6210: prevent deep sleep of 60G device in critical paths Maya Erez
2016-04-25 12:57 ` [PATCH v2 7/7] wil6210: add support for device led configuration Maya Erez
2016-04-25 18:56 ` Kalle Valo [this message]
2016-05-01 7:06 ` merez
2016-05-11 19:34 ` Kalle Valo
2016-05-11 19:46 ` [v2,7/7] " Kalle Valo
2016-04-27 12:56 ` [PATCH v2 0/7] wil6210 patches Kalle Valo
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=87a8kh1pqw.fsf@kamboji.qca.qualcomm.com \
--to=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=qca_merez@qca.qualcomm.com \
--cc=wil6210@qca.qualcomm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.