2009-11-13 03:09:29

by Janakiram Sistla

[permalink] [raw]
Subject: [patch 0/1] Adding radio type FM

>From 1b1493392faeb6702ff364447b135e481930b397 Mon Sep 17 00:00:00 2001
From: Janakiram Sistla <[email protected]>
Date: Fri, 13 Nov 2009 08:16:26 +0530
Subject: [PATCH 1/1] Adding radio type FM

Adding radio type FM in RFKILL_TYPE_.FM also belongs to
same class of with both TX/RX capability.
Also Added input type for the above same.

Signed-off-by: Janakiram Sistla <[email protected]>
---
include/linux/input.h | 1 +
include/linux/rfkill.h | 1 +
net/rfkill/core.c | 2 ++
net/rfkill/input.c | 9 +++++++++
4 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/include/linux/input.h b/include/linux/input.h
index 0ccfc30..f03ae90 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -376,6 +376,7 @@ struct input_absinfo {
#define KEY_DISPLAY_OFF 245 /* display device to off state */

#define KEY_WIMAX 246
+#define KEY_FM 247

/* Range 248 - 255 is reserved for special needs of AT keyboard driver */

diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index 3392c59..03f5598 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -45,6 +45,7 @@ enum rfkill_type {
RFKILL_TYPE_WIMAX,
RFKILL_TYPE_WWAN,
RFKILL_TYPE_GPS,
+ RFKILL_TYPE_FM,
NUM_RFKILL_TYPES,
};

diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index ba2efb9..b8ac206 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -592,6 +592,8 @@ static const char *rfkill_get_type_str(enum
rfkill_type type)
return "wwan";
case RFKILL_TYPE_GPS:
return "gps";
+ case RRFKILL_TYPE_FM:
+ return "fm";
default:
BUG();
}
diff --git a/net/rfkill/input.c b/net/rfkill/input.c
index a7295ad..f51b16d 100644
--- a/net/rfkill/input.c
+++ b/net/rfkill/input.c
@@ -212,6 +212,9 @@ static void rfkill_event(struct input_handle
*handle, unsigned int type,
case KEY_WIMAX:
rfkill_schedule_toggle(RFKILL_TYPE_WIMAX);
break;
+ case KEY_FM:
+ rfkill_schedule_toggle(RFKILL_TYPE_FM);
+ break;
}
} else if (type == EV_SW && code == SW_RFKILL_ALL)
rfkill_schedule_evsw_rfkillall(data);
@@ -290,6 +293,12 @@ static const struct input_device_id rfkill_ids[] = {
.keybit = { [BIT_WORD(KEY_UWB)] = BIT_MASK(KEY_UWB) },
},
{
+ .flags = INPUT_DEVICE_ID_MATCH_EVBIT |
+ INPUT_DEVICE_ID_MATCH_KEYBIT,
+ .evbit = { BIT_MASK(EV_KEY) },
+ .keybit = { [BIT_WORD(KEY_UWB)] = BIT_MASK(KEY_UWB) },
+ },
+ {
.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
.evbit = { BIT_MASK(EV_KEY) },
.keybit = { [BIT_WORD(KEY_WIMAX)] = BIT_MASK(KEY_WIMAX) },
--
1.5.4.3


Regards,
Janakiram.
[email protected]


2009-11-13 03:13:42

by John W. Linville

[permalink] [raw]
Subject: Re: [patch 0/1] Adding radio type FM

On Fri, Nov 13, 2009 at 08:39:27AM +0530, Janakiram Sistla wrote:
> From 1b1493392faeb6702ff364447b135e481930b397 Mon Sep 17 00:00:00 2001
> From: Janakiram Sistla <[email protected]>
> Date: Fri, 13 Nov 2009 08:16:26 +0530
> Subject: [PATCH 1/1] Adding radio type FM
>
> Adding radio type FM in RFKILL_TYPE_.FM also belongs to
> same class of with both TX/RX capability.
> Also Added input type for the above same.
>
> Signed-off-by: Janakiram Sistla <[email protected]>

> @@ -290,6 +293,12 @@ static const struct input_device_id rfkill_ids[] = {
> .keybit = { [BIT_WORD(KEY_UWB)] = BIT_MASK(KEY_UWB) },
> },
> {
> + .flags = INPUT_DEVICE_ID_MATCH_EVBIT |
> + INPUT_DEVICE_ID_MATCH_KEYBIT,
> + .evbit = { BIT_MASK(EV_KEY) },
> + .keybit = { [BIT_WORD(KEY_UWB)] = BIT_MASK(KEY_UWB) },
> + },

Surely this should be KEY_FM?

John
--
John W. Linville ? ? ? ? ? ? ? ?Someday the world will need a hero, and you
[email protected] ? ? ? ? ? ? ? ? ?might be all we have. ?Be ready.

2009-11-13 03:22:53

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [patch 0/1] Adding radio type FM

Hi Janakiram,

> From 1b1493392faeb6702ff364447b135e481930b397 Mon Sep 17 00:00:00 2001
> From: Janakiram Sistla <[email protected]>
> Date: Fri, 13 Nov 2009 08:16:26 +0530
> Subject: [PATCH 1/1] Adding radio type FM
>
> Adding radio type FM in RFKILL_TYPE_.FM also belongs to
> same class of with both TX/RX capability.
> Also Added input type for the above same.
>
> Signed-off-by: Janakiram Sistla <[email protected]>
> ---
> include/linux/input.h | 1 +
> include/linux/rfkill.h | 1 +
> net/rfkill/core.c | 2 ++
> net/rfkill/input.c | 9 +++++++++
> 4 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/input.h b/include/linux/input.h
> index 0ccfc30..f03ae90 100644
> --- a/include/linux/input.h
> +++ b/include/linux/input.h
> @@ -376,6 +376,7 @@ struct input_absinfo {
> #define KEY_DISPLAY_OFF 245 /* display device to off state */
>
> #define KEY_WIMAX 246
> +#define KEY_FM 247
>
> /* Range 248 - 255 is reserved for special needs of AT keyboard driver */
>
> diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
> index 3392c59..03f5598 100644
> --- a/include/linux/rfkill.h
> +++ b/include/linux/rfkill.h
> @@ -45,6 +45,7 @@ enum rfkill_type {
> RFKILL_TYPE_WIMAX,
> RFKILL_TYPE_WWAN,
> RFKILL_TYPE_GPS,
> + RFKILL_TYPE_FM,
> NUM_RFKILL_TYPES,
> };
>
> diff --git a/net/rfkill/core.c b/net/rfkill/core.c
> index ba2efb9..b8ac206 100644
> --- a/net/rfkill/core.c
> +++ b/net/rfkill/core.c
> @@ -592,6 +592,8 @@ static const char *rfkill_get_type_str(enum
> rfkill_type type)
> return "wwan";
> case RFKILL_TYPE_GPS:
> return "gps";
> + case RRFKILL_TYPE_FM:
> + return "fm";
> default:
> BUG();
> }

this part is fine with me.

> diff --git a/net/rfkill/input.c b/net/rfkill/input.c
> index a7295ad..f51b16d 100644
> --- a/net/rfkill/input.c
> +++ b/net/rfkill/input.c
> @@ -212,6 +212,9 @@ static void rfkill_event(struct input_handle
> *handle, unsigned int type,
> case KEY_WIMAX:
> rfkill_schedule_toggle(RFKILL_TYPE_WIMAX);
> break;
> + case KEY_FM:
> + rfkill_schedule_toggle(RFKILL_TYPE_FM);
> + break;
> }
> } else if (type == EV_SW && code == SW_RFKILL_ALL)
> rfkill_schedule_evsw_rfkillall(data);
> @@ -290,6 +293,12 @@ static const struct input_device_id rfkill_ids[] = {
> .keybit = { [BIT_WORD(KEY_UWB)] = BIT_MASK(KEY_UWB) },
> },
> {
> + .flags = INPUT_DEVICE_ID_MATCH_EVBIT |
> + INPUT_DEVICE_ID_MATCH_KEYBIT,
> + .evbit = { BIT_MASK(EV_KEY) },
> + .keybit = { [BIT_WORD(KEY_UWB)] = BIT_MASK(KEY_UWB) },
> + },
> + {
> .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
> .evbit = { BIT_MASK(EV_KEY) },
> .keybit = { [BIT_WORD(KEY_WIMAX)] = BIT_MASK(KEY_WIMAX) },

So besides the pointed of the copy-and-paste mistake, I don't think we
should be doing this. Unless you point me to hardware that actually has
a physical RFKILL button for FM. We also didn't add key define for GPS
since there is no hardware that has this.

If you think you need this for some weird handling then go one step back
and read the re-written RFKILL subsystem design.

Regards

Marcel

2009-11-13 03:25:23

by Janakiram Sistla

[permalink] [raw]
Subject: Re: [patch 0/1] Adding radio type FM

Resending with added comments from John.
>From 1b1493392faeb6702ff364447b135e481930b397 Mon Sep 17 00:00:00 2001
From: Janakiram Sistla <[email protected]>
Date: Fri, 13 Nov 2009 08:16:26 +0530
Subject: [PATCH 1/1] Adding radio type FM

Adding radio type FM in RFKILL_TYPE_.FM also belongs to
same class of with both TX/RX capability.
Also Added input type for the above same.

Signed-off-by: Janakiram Sistla <[email protected]>
---
include/linux/input.h | 1 +
include/linux/rfkill.h | 1 +
net/rfkill/core.c | 2 ++
net/rfkill/input.c | 9 +++++++++
4 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/include/linux/input.h b/include/linux/input.h
index 0ccfc30..f03ae90 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -376,6 +376,7 @@ struct input_absinfo {
#define KEY_DISPLAY_OFF 245 /* display device to off state */

#define KEY_WIMAX 246
+#define KEY_FM 247

/* Range 248 - 255 is reserved for special needs of AT keyboard driver */

diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index 3392c59..03f5598 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -45,6 +45,7 @@ enum rfkill_type {
RFKILL_TYPE_WIMAX,
RFKILL_TYPE_WWAN,
RFKILL_TYPE_GPS,
+ RFKILL_TYPE_FM,
NUM_RFKILL_TYPES,
};

diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index ba2efb9..b8ac206 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -592,6 +592,8 @@ static const char *rfkill_get_type_str(enum
rfkill_type type)
return "wwan";
case RFKILL_TYPE_GPS:
return "gps";
+ case RRFKILL_TYPE_FM:
+ return "fm";
default:
BUG();
}
diff --git a/net/rfkill/input.c b/net/rfkill/input.c
index a7295ad..f51b16d 100644
--- a/net/rfkill/input.c
+++ b/net/rfkill/input.c
@@ -212,6 +212,9 @@ static void rfkill_event(struct input_handle
*handle, unsigned int type,
case KEY_WIMAX:
rfkill_schedule_toggle(RFKILL_TYPE_WIMAX);
break;
+ case KEY_FM:
+ rfkill_schedule_toggle(RFKILL_TYPE_FM);
+ break;
}
} else if (type == EV_SW && code == SW_RFKILL_ALL)
rfkill_schedule_evsw_rfkillall(data);
@@ -290,6 +293,12 @@ static const struct input_device_id rfkill_ids[] = {
.keybit = { [BIT_WORD(KEY_UWB)] = BIT_MASK(KEY_UWB) },
},
{
+ .flags = INPUT_DEVICE_ID_MATCH_EVBIT |
+ INPUT_DEVICE_ID_MATCH_KEYBIT,
+ .evbit = { BIT_MASK(EV_KEY) },
+ .keybit = { [BIT_WORD(KEY_FM)] = BIT_MASK(KEY_UWB) },
+ },
+ {
.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
.evbit = { BIT_MASK(EV_KEY) },
.keybit = { [BIT_WORD(KEY_WIMAX)] = BIT_MASK(KEY_WIMAX) },
--
1.5.4.3

Regards,
Ram.

2009-11-13 03:29:44

by Julian Calaby

[permalink] [raw]
Subject: Re: [patch 0/1] Adding radio type FM

On Fri, Nov 13, 2009 at 14:25, Janakiram Sistla
<[email protected]> wrote:
> Resending with added comments from John.
> From 1b1493392faeb6702ff364447b135e481930b397 Mon Sep 17 00:00:00 2001
> From: Janakiram Sistla <[email protected]>
> Date: Fri, 13 Nov 2009 08:16:26 +0530
> Subject: [PATCH 1/1] Adding radio type FM
>
> Adding radio type FM in RFKILL_TYPE_.FM also belongs to
> same class of with both TX/RX capability.
> Also Added input type for the above same.
>
> Signed-off-by: Janakiram Sistla <[email protected]>
> ---
> ?include/linux/input.h ?| ? ?1 +
> ?include/linux/rfkill.h | ? ?1 +
> ?net/rfkill/core.c ? ? ?| ? ?2 ++
> ?net/rfkill/input.c ? ? | ? ?9 +++++++++
> ?4 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/input.h b/include/linux/input.h
> index 0ccfc30..f03ae90 100644
> --- a/include/linux/input.h
> +++ b/include/linux/input.h
> @@ -376,6 +376,7 @@ struct input_absinfo {
> ?#define KEY_DISPLAY_OFF ? ? ? ? ? ? ? ?245 ? ? /* display device to off state */
>
> ?#define KEY_WIMAX ? ? ? ? ? ? ?246
> +#define KEY_FM ? ? ? ? ? ? ? ? 247
>
> ?/* Range 248 - 255 is reserved for special needs of AT keyboard driver */
>
> diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
> index 3392c59..03f5598 100644
> --- a/include/linux/rfkill.h
> +++ b/include/linux/rfkill.h
> @@ -45,6 +45,7 @@ enum rfkill_type {
> ? ? ? ?RFKILL_TYPE_WIMAX,
> ? ? ? ?RFKILL_TYPE_WWAN,
> ? ? ? ?RFKILL_TYPE_GPS,
> + ? ? ? RFKILL_TYPE_FM,
> ? ? ? ?NUM_RFKILL_TYPES,
> ?};
>
> diff --git a/net/rfkill/core.c b/net/rfkill/core.c
> index ba2efb9..b8ac206 100644
> --- a/net/rfkill/core.c
> +++ b/net/rfkill/core.c
> @@ -592,6 +592,8 @@ static const char *rfkill_get_type_str(enum
> rfkill_type type)
> ? ? ? ? ? ? ? ?return "wwan";
> ? ? ? ?case RFKILL_TYPE_GPS:
> ? ? ? ? ? ? ? ?return "gps";
> + ? ? ? case RRFKILL_TYPE_FM:
> + ? ? ? ? ? ? ? return "fm";
> ? ? ? ?default:
> ? ? ? ? ? ? ? ?BUG();
> ? ? ? ?}
> diff --git a/net/rfkill/input.c b/net/rfkill/input.c
> index a7295ad..f51b16d 100644
> --- a/net/rfkill/input.c
> +++ b/net/rfkill/input.c
> @@ -212,6 +212,9 @@ static void rfkill_event(struct input_handle
> *handle, unsigned int type,
> ? ? ? ? ? ? ? ?case KEY_WIMAX:
> ? ? ? ? ? ? ? ? ? ? ? ?rfkill_schedule_toggle(RFKILL_TYPE_WIMAX);
> ? ? ? ? ? ? ? ? ? ? ? ?break;
> + ? ? ? ? ? ? ? case KEY_FM:
> + ? ? ? ? ? ? ? ? ? ? ? rfkill_schedule_toggle(RFKILL_TYPE_FM);
> + ? ? ? ? ? ? ? ? ? ? ? break;
> ? ? ? ? ? ? ? ?}
> ? ? ? ?} else if (type == EV_SW && code == SW_RFKILL_ALL)
> ? ? ? ? ? ? ? ?rfkill_schedule_evsw_rfkillall(data);
> @@ -290,6 +293,12 @@ static const struct input_device_id rfkill_ids[] = {
> ? ? ? ? ? ? ? ?.keybit = { [BIT_WORD(KEY_UWB)] = BIT_MASK(KEY_UWB) },
> ? ? ? ?},
> ? ? ? ?{
> + ? ? ? ? ? ? ? .flags = INPUT_DEVICE_ID_MATCH_EVBIT |
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? INPUT_DEVICE_ID_MATCH_KEYBIT,
> + ? ? ? ? ? ? ? .evbit = { BIT_MASK(EV_KEY) },
> + ? ? ? ? ? ? ? .keybit = { [BIT_WORD(KEY_FM)] = BIT_MASK(KEY_UWB) },

Surely both instances of KEY_UWB should be changed.

> + ? ? ? },
> + ? ? ? {
> ? ? ? ? ? ? ? ?.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
> ? ? ? ? ? ? ? ?.evbit = { BIT_MASK(EV_KEY) },
> ? ? ? ? ? ? ? ?.keybit = { [BIT_WORD(KEY_WIMAX)] = BIT_MASK(KEY_WIMAX) },
> --
> 1.5.4.3
>
> Regards,
> Ram.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
>



--
Julian Calaby

Email: [email protected]
.Plan: http://sites.google.com/site/juliancalaby/

2009-11-13 03:41:48

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [patch 0/1] Adding radio type FM

Hi Julian,

please stop CCing [email protected] since that one is not a
mailing list.

> <[email protected]> wrote:
> > Resending with added comments from John.
> > From 1b1493392faeb6702ff364447b135e481930b397 Mon Sep 17 00:00:00 2001
> > From: Janakiram Sistla <[email protected]>
> > Date: Fri, 13 Nov 2009 08:16:26 +0530
> > Subject: [PATCH 1/1] Adding radio type FM
> >
> > Adding radio type FM in RFKILL_TYPE_.FM also belongs to
> > same class of with both TX/RX capability.
> > Also Added input type for the above same.
> >
> > Signed-off-by: Janakiram Sistla <[email protected]>
> > ---
> > include/linux/input.h | 1 +
> > include/linux/rfkill.h | 1 +
> > net/rfkill/core.c | 2 ++
> > net/rfkill/input.c | 9 +++++++++
> > 4 files changed, 13 insertions(+), 0 deletions(-)
> >
> > diff --git a/include/linux/input.h b/include/linux/input.h
> > index 0ccfc30..f03ae90 100644
> > --- a/include/linux/input.h
> > +++ b/include/linux/input.h
> > @@ -376,6 +376,7 @@ struct input_absinfo {
> > #define KEY_DISPLAY_OFF 245 /* display device to off state */
> >
> > #define KEY_WIMAX 246
> > +#define KEY_FM 247
> >
> > /* Range 248 - 255 is reserved for special needs of AT keyboard driver */
> >
> > diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
> > index 3392c59..03f5598 100644
> > --- a/include/linux/rfkill.h
> > +++ b/include/linux/rfkill.h
> > @@ -45,6 +45,7 @@ enum rfkill_type {
> > RFKILL_TYPE_WIMAX,
> > RFKILL_TYPE_WWAN,
> > RFKILL_TYPE_GPS,
> > + RFKILL_TYPE_FM,
> > NUM_RFKILL_TYPES,
> > };
> >
> > diff --git a/net/rfkill/core.c b/net/rfkill/core.c
> > index ba2efb9..b8ac206 100644
> > --- a/net/rfkill/core.c
> > +++ b/net/rfkill/core.c
> > @@ -592,6 +592,8 @@ static const char *rfkill_get_type_str(enum
> > rfkill_type type)
> > return "wwan";
> > case RFKILL_TYPE_GPS:
> > return "gps";
> > + case RRFKILL_TYPE_FM:
> > + return "fm";
> > default:
> > BUG();
> > }
> > diff --git a/net/rfkill/input.c b/net/rfkill/input.c
> > index a7295ad..f51b16d 100644
> > --- a/net/rfkill/input.c
> > +++ b/net/rfkill/input.c
> > @@ -212,6 +212,9 @@ static void rfkill_event(struct input_handle
> > *handle, unsigned int type,
> > case KEY_WIMAX:
> > rfkill_schedule_toggle(RFKILL_TYPE_WIMAX);
> > break;
> > + case KEY_FM:
> > + rfkill_schedule_toggle(RFKILL_TYPE_FM);
> > + break;
> > }
> > } else if (type == EV_SW && code == SW_RFKILL_ALL)
> > rfkill_schedule_evsw_rfkillall(data);
> > @@ -290,6 +293,12 @@ static const struct input_device_id rfkill_ids[] = {
> > .keybit = { [BIT_WORD(KEY_UWB)] = BIT_MASK(KEY_UWB) },
> > },
> > {
> > + .flags = INPUT_DEVICE_ID_MATCH_EVBIT |
> > + INPUT_DEVICE_ID_MATCH_KEYBIT,
> > + .evbit = { BIT_MASK(EV_KEY) },
> > + .keybit = { [BIT_WORD(KEY_FM)] = BIT_MASK(KEY_UWB) },
>
> Surely both instances of KEY_UWB should be changed.

which makes it even more clearly that this code path has never been
tested. So lets leave this KEY_FM business out and just submit the
RFKILL additions.

You don't need to emulate a key event to use RFKILL anyway. The new
RFKILL subsystem supports /dev/rfkill and there is the rfkill userspace
utility. Which you wanna send a patch to extend it with FM support.

Regards

Marcel

2009-11-13 03:45:32

by Julian Calaby

[permalink] [raw]
Subject: Re: [patch 0/1] Adding radio type FM

On Fri, Nov 13, 2009 at 14:41, Marcel Holtmann <[email protected]> wrote:
> Hi Julian,
>
> please stop CCing [email protected] since that one is not a
> mailing list.

I never intended to: I didn't check the CCs when I hit reply-all.

I realised it had been CC'd right after it sent me an email telling me
(in a rather verbose fashion) that I was an idiot.

Thanks,

--

Julian Calaby

Email: [email protected]
.Plan: http://sites.google.com/site/juliancalaby/

2009-11-13 05:19:24

by Janakiram Sistla

[permalink] [raw]
Subject: Re: [patch 0/1] Adding radio type FM

Hi Marcel,

Thankyou for all the comments on the patch.Yes if you see the toshiba
Laptop series which have an FM key that enables FM.If still People say
that we cannot take KEY_FM yes we will go ahead and will resubmit a
patch with only RFKILL for FM

Regards,
Ram.

On Fri, Nov 13, 2009 at 9:15 AM, Julian Calaby <[email protected]> wrote:
> On Fri, Nov 13, 2009 at 14:41, Marcel Holtmann <[email protected]> wrote:
>> Hi Julian,
>>
>> please stop CCing [email protected] since that one is not a
>> mailing list.
>
> I never intended to: I didn't check the CCs when I hit reply-all.
>
> I realised it had been CC'd right after it sent me an email telling me
> (in a rather verbose fashion) that I was an idiot.
>
> Thanks,
>
> --
>
> Julian Calaby
>
> Email: [email protected]
> .Plan: http://sites.google.com/site/juliancalaby/
>

2009-11-13 05:30:33

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [patch 0/1] Adding radio type FM

Hi Janakiram,

> Thankyou for all the comments on the patch.Yes if you see the toshiba
> Laptop series which have an FM key that enables FM.If still People say
> that we cannot take KEY_FM yes we will go ahead and will resubmit a
> patch with only RFKILL for FM

how is that key mapped in reality? Or is that just a KEY_RFKILL toggle
sort of key.

Submit the patch without the input modifications since that can be acked
right away. And don't forget to send a patch for rfkill utility that
adds FM support.

Regards

Marcel

2009-11-13 05:32:08

by Janakiram Sistla

[permalink] [raw]
Subject: Re: [patch 0/1] Adding radio type FM

HI Marcel,

Yes as pointed out i am pointing to Toshiba Satellite A305
notebook.This has an FM key which enables FM.

Regards,
Ram.
On 11/13/09, Marcel Holtmann <[email protected]> wrote:
> Hi Janakiram,
>
> > From 1b1493392faeb6702ff364447b135e481930b397 Mon Sep 17 00:00:00 2001
> > From: Janakiram Sistla <[email protected]>
> > Date: Fri, 13 Nov 2009 08:16:26 +0530
> > Subject: [PATCH 1/1] Adding radio type FM
> >
> > Adding radio type FM in RFKILL_TYPE_.FM also belongs to
> > same class of with both TX/RX capability.
> > Also Added input type for the above same.
> >
> > Signed-off-by: Janakiram Sistla <[email protected]>
> > ---
> > include/linux/input.h | 1 +
> > include/linux/rfkill.h | 1 +
> > net/rfkill/core.c | 2 ++
> > net/rfkill/input.c | 9 +++++++++
> > 4 files changed, 13 insertions(+), 0 deletions(-)
> >
> > diff --git a/include/linux/input.h b/include/linux/input.h
> > index 0ccfc30..f03ae90 100644
> > --- a/include/linux/input.h
> > +++ b/include/linux/input.h
> > @@ -376,6 +376,7 @@ struct input_absinfo {
> > #define KEY_DISPLAY_OFF 245 /* display device to off state */
> >
> > #define KEY_WIMAX 246
> > +#define KEY_FM 247
> >
> > /* Range 248 - 255 is reserved for special needs of AT keyboard driver */
> >
> > diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
> > index 3392c59..03f5598 100644
> > --- a/include/linux/rfkill.h
> > +++ b/include/linux/rfkill.h
> > @@ -45,6 +45,7 @@ enum rfkill_type {
> > RFKILL_TYPE_WIMAX,
> > RFKILL_TYPE_WWAN,
> > RFKILL_TYPE_GPS,
> > + RFKILL_TYPE_FM,
> > NUM_RFKILL_TYPES,
> > };
> >
> > diff --git a/net/rfkill/core.c b/net/rfkill/core.c
> > index ba2efb9..b8ac206 100644
> > --- a/net/rfkill/core.c
> > +++ b/net/rfkill/core.c
> > @@ -592,6 +592,8 @@ static const char *rfkill_get_type_str(enum
> > rfkill_type type)
> > return "wwan";
> > case RFKILL_TYPE_GPS:
> > return "gps";
> > + case RRFKILL_TYPE_FM:
> > + return "fm";
> > default:
> > BUG();
> > }
>
> this part is fine with me.
>
> > diff --git a/net/rfkill/input.c b/net/rfkill/input.c
> > index a7295ad..f51b16d 100644
> > --- a/net/rfkill/input.c
> > +++ b/net/rfkill/input.c
> > @@ -212,6 +212,9 @@ static void rfkill_event(struct input_handle
> > *handle, unsigned int type,
> > case KEY_WIMAX:
> > rfkill_schedule_toggle(RFKILL_TYPE_WIMAX);
> > break;
> > + case KEY_FM:
> > + rfkill_schedule_toggle(RFKILL_TYPE_FM);
> > + break;
> > }
> > } else if (type == EV_SW && code == SW_RFKILL_ALL)
> > rfkill_schedule_evsw_rfkillall(data);
> > @@ -290,6 +293,12 @@ static const struct input_device_id rfkill_ids[] = {
> > .keybit = { [BIT_WORD(KEY_UWB)] = BIT_MASK(KEY_UWB) },
> > },
> > {
> > + .flags = INPUT_DEVICE_ID_MATCH_EVBIT |
> > + INPUT_DEVICE_ID_MATCH_KEYBIT,
> > + .evbit = { BIT_MASK(EV_KEY) },
> > + .keybit = { [BIT_WORD(KEY_UWB)] = BIT_MASK(KEY_UWB) },
> > + },
> > + {
> > .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
> > .evbit = { BIT_MASK(EV_KEY) },
> > .keybit = { [BIT_WORD(KEY_WIMAX)] = BIT_MASK(KEY_WIMAX) },
>
> So besides the pointed of the copy-and-paste mistake, I don't think we
> should be doing this. Unless you point me to hardware that actually has
> a physical RFKILL button for FM. We also didn't add key define for GPS
> since there is no hardware that has this.
>
> If you think you need this for some weird handling then go one step back
> and read the re-written RFKILL subsystem design.
>
> Regards
>
> Marcel
>
>
>

2009-11-13 18:19:19

by Janakiram Sistla

[permalink] [raw]
Subject: Re: [patch 0/1] Adding radio type FM

Hi Marcel,

Let me know if this patch can go ahead...........and i can go ahead
with this in rfkill utility.......

Regards,
Ram.

On Fri, Nov 13, 2009 at 11:02 AM, Janakiram Sistla
<[email protected]> wrote:
> HI Marcel,
>
> Yes as pointed out i am pointing to Toshiba Satellite A305
> notebook.This has an FM key which enables FM.
>
> Regards,
> Ram.
> On 11/13/09, Marcel Holtmann <[email protected]> wrote:
>> Hi Janakiram,
>>
>> > From 1b1493392faeb6702ff364447b135e481930b397 Mon Sep 17 00:00:00 2001
>> > From: Janakiram Sistla <[email protected]>
>> > Date: Fri, 13 Nov 2009 08:16:26 +0530
>> > Subject: [PATCH 1/1] Adding radio type FM
>> >
>> > Adding radio type FM in RFKILL_TYPE_.FM also belongs to
>> > same class of with both TX/RX capability.
>> > Also Added input type for the above same.
>> >
>> > Signed-off-by: Janakiram Sistla <[email protected]>
>> > ---
>> > ?include/linux/input.h ?| ? ?1 +
>> > ?include/linux/rfkill.h | ? ?1 +
>> > ?net/rfkill/core.c ? ? ?| ? ?2 ++
>> > ?net/rfkill/input.c ? ? | ? ?9 +++++++++
>> > ?4 files changed, 13 insertions(+), 0 deletions(-)
>> >
>> > diff --git a/include/linux/input.h b/include/linux/input.h
>> > index 0ccfc30..f03ae90 100644
>> > --- a/include/linux/input.h
>> > +++ b/include/linux/input.h
>> > @@ -376,6 +376,7 @@ struct input_absinfo {
>> > ?#define KEY_DISPLAY_OFF ? ? ? ? ? ? ?245 ? ? /* display device to off state */
>> >
>> > ?#define KEY_WIMAX ? ? ? ? ? ?246
>> > +#define KEY_FM ? ? ? ? ? ? ? ? ? ? ? 247
>> >
>> > ?/* Range 248 - 255 is reserved for special needs of AT keyboard driver */
>> >
>> > diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
>> > index 3392c59..03f5598 100644
>> > --- a/include/linux/rfkill.h
>> > +++ b/include/linux/rfkill.h
>> > @@ -45,6 +45,7 @@ enum rfkill_type {
>> > ? ? ? RFKILL_TYPE_WIMAX,
>> > ? ? ? RFKILL_TYPE_WWAN,
>> > ? ? ? RFKILL_TYPE_GPS,
>> > + ? ? RFKILL_TYPE_FM,
>> > ? ? ? NUM_RFKILL_TYPES,
>> > ?};
>> >
>> > diff --git a/net/rfkill/core.c b/net/rfkill/core.c
>> > index ba2efb9..b8ac206 100644
>> > --- a/net/rfkill/core.c
>> > +++ b/net/rfkill/core.c
>> > @@ -592,6 +592,8 @@ static const char *rfkill_get_type_str(enum
>> > rfkill_type type)
>> > ? ? ? ? ? ? ? return "wwan";
>> > ? ? ? case RFKILL_TYPE_GPS:
>> > ? ? ? ? ? ? ? return "gps";
>> > + ? ? case RRFKILL_TYPE_FM:
>> > + ? ? ? ? ? ? return "fm";
>> > ? ? ? default:
>> > ? ? ? ? ? ? ? BUG();
>> > ? ? ? }
>>
>> this part is fine with me.
>>
>> > diff --git a/net/rfkill/input.c b/net/rfkill/input.c
>> > index a7295ad..f51b16d 100644
>> > --- a/net/rfkill/input.c
>> > +++ b/net/rfkill/input.c
>> > @@ -212,6 +212,9 @@ static void rfkill_event(struct input_handle
>> > *handle, unsigned int type,
>> > ? ? ? ? ? ? ? case KEY_WIMAX:
>> > ? ? ? ? ? ? ? ? ? ? ? rfkill_schedule_toggle(RFKILL_TYPE_WIMAX);
>> > ? ? ? ? ? ? ? ? ? ? ? break;
>> > + ? ? ? ? ? ? case KEY_FM:
>> > + ? ? ? ? ? ? ? ? ? ? rfkill_schedule_toggle(RFKILL_TYPE_FM);
>> > + ? ? ? ? ? ? ? ? ? ? break;
>> > ? ? ? ? ? ? ? }
>> > ? ? ? } else if (type == EV_SW && code == SW_RFKILL_ALL)
>> > ? ? ? ? ? ? ? rfkill_schedule_evsw_rfkillall(data);
>> > @@ -290,6 +293,12 @@ static const struct input_device_id rfkill_ids[] = {
>> > ? ? ? ? ? ? ? .keybit = { [BIT_WORD(KEY_UWB)] = BIT_MASK(KEY_UWB) },
>> > ? ? ? },
>> > ? ? ? {
>> > + ? ? ? ? ? ? .flags = INPUT_DEVICE_ID_MATCH_EVBIT |
>> > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? INPUT_DEVICE_ID_MATCH_KEYBIT,
>> > + ? ? ? ? ? ? .evbit = { BIT_MASK(EV_KEY) },
>> > + ? ? ? ? ? ? .keybit = { [BIT_WORD(KEY_UWB)] = BIT_MASK(KEY_UWB) },
>> > + ? ? },
>> > + ? ? {
>> > ? ? ? ? ? ? ? .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
>> > ? ? ? ? ? ? ? .evbit = { BIT_MASK(EV_KEY) },
>> > ? ? ? ? ? ? ? .keybit = { [BIT_WORD(KEY_WIMAX)] = BIT_MASK(KEY_WIMAX) },
>>
>> So besides the pointed of the copy-and-paste mistake, I don't think we
>> should be doing this. Unless you point me to hardware that actually has
>> a physical RFKILL button for FM. We also didn't add key define for GPS
>> since there is no hardware that has this.
>>
>> If you think you need this for some weird handling then go one step back
>> and read the re-written RFKILL subsystem design.
>>
>> Regards
>>
>> Marcel
>>
>>
>>
>

2009-11-14 13:19:17

by Janakiram Sistla

[permalink] [raw]
Subject: Re: [patch 0/1] Adding radio type FM

Resubmitting patch adding Marcels Comments

>From f72e4bdef7c423259f2f8f0615d024a25294ea8f Mon Sep 17 00:00:00 2001
From: Janakiram Sistla <[email protected]>
Date: Sat, 14 Nov 2009 18:42:35 +0530
Subject: [PATCH 1/1] Adding radio type FM

Adding radio type FM in RFKILL_TYPE_.FM also belongs to
same class of with both TX/RX capability.

Signed-off-by: Janakiram Sistla <[email protected]>
---
include/linux/rfkill.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index 3392c59..03f5598 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -45,6 +45,7 @@ enum rfkill_type {
RFKILL_TYPE_WIMAX,
RFKILL_TYPE_WWAN,
RFKILL_TYPE_GPS,
+ RFKILL_TYPE_FM,
NUM_RFKILL_TYPES,
};

--
1.5.4.3

2009-11-14 16:34:37

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [patch 0/1] Adding radio type FM

Hi Janakiram,

> Resubmitting patch adding Marcels Comments
>
> From f72e4bdef7c423259f2f8f0615d024a25294ea8f Mon Sep 17 00:00:00 2001
> From: Janakiram Sistla <[email protected]>
> Date: Sat, 14 Nov 2009 18:42:35 +0530
> Subject: [PATCH 1/1] Adding radio type FM
>
> Adding radio type FM in RFKILL_TYPE_.FM also belongs to
> same class of with both TX/RX capability.
>
> Signed-off-by: Janakiram Sistla <[email protected]>
> ---
> include/linux/rfkill.h | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
> index 3392c59..03f5598 100644
> --- a/include/linux/rfkill.h
> +++ b/include/linux/rfkill.h
> @@ -45,6 +45,7 @@ enum rfkill_type {
> RFKILL_TYPE_WIMAX,
> RFKILL_TYPE_WWAN,
> RFKILL_TYPE_GPS,
> + RFKILL_TYPE_FM,
> NUM_RFKILL_TYPES,
> };

and what about rfkill_get_type_str() changes?

Regards

Marcel

2009-11-14 17:37:51

by Janakiram Sistla

[permalink] [raw]
Subject: Re: [patch 0/1] Adding radio type FM

Hi Marcel,

I thought i would see the change first in include/linux/rfkill.h
getting accepted and then i can add the change in core.c also.

Let me know if i can push both in the same patch.

Regards,
Ram.

On Sat, Nov 14, 2009 at 10:04 PM, Marcel Holtmann <[email protected]> wrote:
> Hi Janakiram,
>
>> Resubmitting patch ?adding Marcels Comments
>>
>> From f72e4bdef7c423259f2f8f0615d024a25294ea8f Mon Sep 17 00:00:00 2001
>> From: Janakiram Sistla <[email protected]>
>> Date: Sat, 14 Nov 2009 18:42:35 +0530
>> Subject: [PATCH 1/1] Adding radio type FM
>>
>> Adding radio type FM in RFKILL_TYPE_.FM also belongs to
>> same class of with both TX/RX capability.
>>
>> Signed-off-by: Janakiram Sistla <[email protected]>
>> ---
>> ?include/linux/rfkill.h | ? ?1 +
>> ?1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
>> index 3392c59..03f5598 100644
>> --- a/include/linux/rfkill.h
>> +++ b/include/linux/rfkill.h
>> @@ -45,6 +45,7 @@ enum rfkill_type {
>> ? ? ? RFKILL_TYPE_WIMAX,
>> ? ? ? RFKILL_TYPE_WWAN,
>> ? ? ? RFKILL_TYPE_GPS,
>> + ? ? RFKILL_TYPE_FM,
>> ? ? ? NUM_RFKILL_TYPES,
>> ?};
>
> and what about rfkill_get_type_str() changes?
>
> Regards
>
> Marcel
>
>
>

2009-11-14 18:05:12

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [patch 0/1] Adding radio type FM

Hi Janakiram,

> I thought i would see the change first in include/linux/rfkill.h
> getting accepted and then i can add the change in core.c also.
>
> Let me know if i can push both in the same patch.

I said that you can add RFKILL_TYPE_FM to the RFKILL subsystem, but the
input changes might not be the right ones. Since eventually the
in-kernel input support will be removed.

And I did ask if the FM button you see is a generic RFKILL toggle or a
FM specific button. Especially since you had a copy-and-paste mistake in
your patches, that code path clearly was never tested by you.

Regards

Marcel

2009-11-16 02:36:20

by Janakiram Sistla

[permalink] [raw]
Subject: [PATCH 1/1] Adding radio type FM

Adding changes RFKILL type FM and for RFKILL for FM in core

>From 4bf0ae6c90de9a766914abeb5ab5e5428089b648 Mon Sep 17 00:00:00 2001
From: Janakiram Sistla <[email protected]>
Date: Mon, 16 Nov 2009 07:58:09 +0530
Subject: [PATCH 1/1] Adding radio type FM

Adding radio type FM in RFKILL_TYPE_.FM belongs to
same class of with both TX/RX capability.

Signed-off-by: Janakiram Sistla <[email protected]>
---
include/linux/rfkill.h | 1 +
net/rfkill/core.c | 2 ++
2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index 3392c59..03f5598 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -45,6 +45,7 @@ enum rfkill_type {
RFKILL_TYPE_WIMAX,
RFKILL_TYPE_WWAN,
RFKILL_TYPE_GPS,
+ RFKILL_TYPE_FM,
NUM_RFKILL_TYPES,
};

diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index ba2efb9..61b716e 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -590,6 +590,8 @@ static const char *rfkill_get_type_str(enum
rfkill_type type)
return "wimax";
case RFKILL_TYPE_WWAN:
return "wwan";
+ case RFKILL_TYPE_FM:
+ return "fm";
case RFKILL_TYPE_GPS:
return "gps";
default:
--
1.5.4.3

2009-11-16 02:43:31

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH 1/1] Adding radio type FM

Hi Janakiram,

so first of all, please stop sending emails to majordomo. That is not a
real person.

> Adding changes RFKILL type FM and for RFKILL for FM in core
>
> From 4bf0ae6c90de9a766914abeb5ab5e5428089b648 Mon Sep 17 00:00:00 2001
> From: Janakiram Sistla <[email protected]>
> Date: Mon, 16 Nov 2009 07:58:09 +0530
> Subject: [PATCH 1/1] Adding radio type FM
>
> Adding radio type FM in RFKILL_TYPE_.FM belongs to
> same class of with both TX/RX capability.
>
> Signed-off-by: Janakiram Sistla <[email protected]>

the patch itself is fine, but can we get at least one with a proper
commit message. And if you mailer is broken, then either fix it or use
git send-email.

Regards

Marcel

2009-11-16 04:25:43

by Janakiram Sistla

[permalink] [raw]
Subject: Re: [PATCH 1/1] Adding radio type FM

Hi Marcel,

I am sorry about this.There is a problem with my git send-email.so i
had to use the mailer.I will surely take complete precaution that it
will not repeat further.

Regards,
Ram.

On 11/16/09, Marcel Holtmann <[email protected]> wrote:
> Hi Janakiram,
>
> so first of all, please stop sending emails to majordomo. That is not a
> real person.
>
> > Adding changes RFKILL type FM and for RFKILL for FM in core
> >
> > From 4bf0ae6c90de9a766914abeb5ab5e5428089b648 Mon Sep 17 00:00:00 2001
> > From: Janakiram Sistla <[email protected]>
> > Date: Mon, 16 Nov 2009 07:58:09 +0530
> > Subject: [PATCH 1/1] Adding radio type FM
> >
> > Adding radio type FM in RFKILL_TYPE_.FM belongs to
> > same class of with both TX/RX capability.
> >
> > Signed-off-by: Janakiram Sistla <[email protected]>
>
> the patch itself is fine, but can we get at least one with a proper
> commit message. And if you mailer is broken, then either fix it or use
> git send-email.
>
> Regards
>
> Marcel
>
>
>