summaryrefslogtreecommitdiff
path: root/net/rfkill/rfkill-gpio.c
AgeCommit message (Collapse)Author
2014-09-22net: rfkill: gpio: Fix clock statusLoic Poulain
Clock is disabled when the device is blocked. So, clock_enabled is the logical negation of "blocked". Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-16net: rfkill: gpio: Enable module auto-loading for ACPI based switchesMarcel Holtmann
For the ACPI based switches the MODULE_DEVICE_TABLE is missing to export the entries for module auto-loading. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-25net: rfkill: gpio: Add more Broadcom bluetooth ACPI IDsMika Westerberg
This adds one more ACPI ID of a Broadcom bluetooth chip. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-05-22Merge git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-nextJohn W. Linville
2014-05-07rfkill-gpio: Use gpio cansleep versionLoic Poulain
If gpio controller requires waiting for read and write GPIO values, then we have to use the gpio cansleep api. Fix the rfkill_gpio_set_power which calls only the nonsleep version (causing kernel warning). There is no problem to use the cansleep version here because we are not in IRQ handler or similar context (cf rfkill_set_block). Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-04-11net: rfkill: gpio: hard-code the gpio namesHeikki Krogerus
There is no need to dynamically generate the names. This will fix a static checker warning.. net/rfkill/rfkill-gpio.c:144 rfkill_gpio_probe() warn: variable dereferenced before check 'rfkill->name' Acked-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-04-11net: rfkill: gpio: add ACPI IDs for a Broadcom bluetooth chipHeikki Krogerus
This adds ACPI IDs for Broadcom bluetooth chip BCM43241 used on various Baytrail based boards such as Lenovo Miix 2 and Asus Transformer Book T100TA. Acked-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-04-11net: rfkill: gpio: add ACPI ID for GPS module on Lenovo Miix2Heikki Krogerus
On Lenovo Miix 2 8", BCM4752 is renamed LNV4752. Acked-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-04-11net: rfkill: gpio: remove unused and obsolete platform parametersHeikki Krogerus
After upgrading to descriptor based gpios, the gpio numbers are not used anymore. The power_clk_name and the platform specific setup and close hooks are not used by anybody, and we should not encourage use of such things, so removing them. Acked-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-01-07net: rfkill: gpio: convert to descriptor-based GPIO interfaceHeikki Krogerus
Convert to the safer gpiod_* family of API functions. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Tested-by: Stephen Warren <swarren@nvidia.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2013-10-28net: rfkill: gpio: add ACPI supportHeikki Krogerus
Including ACPI ID for Broadcom GPS receiver BCM4752. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Rhyland Klein <rklein@nvidia.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-28net: rfkill: gpio: prepare for DT and ACPI supportHeikki Krogerus
This will add the relevant values like the gpios and the type in rfkill_gpio_platform_data to the rfkill_gpio_data structure. It will allow those values to be easily picked from DT and ACPI tables later. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Rhyland Klein <rklein@nvidia.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-28net: rfkill: gpio: spinlock-safe GPIO accessHeikki Krogerus
This sets the direction of the gpio once when it's requested, and uses the spinlock-safe gpio_set_state() to change the state. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Rhyland Klein <rklein@nvidia.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-28net: rfkill: gpio: clean up clock handlingHeikki Krogerus
Use a simple flag to see the state of the clock, and make the clock available even without a name. Also, get rid of HAVE_CLK dependency. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Rhyland Klein <rklein@nvidia.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-28net: rfkill: gpio: convert to resource managed allocationHeikki Krogerus
And remove now unneeded resource freeing. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Rhyland Klein <rklein@nvidia.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-04-22rfkill: fix error return code in rfkill_gpio_probe()Wei Yongjun
Fix to return a negative error code from the error handling case instead of 0, as returned elsewhere in this function. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> [fix some indentation on the way] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-12-06rfkill: remove __dev* attributesBill Pemberton
CONFIG_HOTPLUG is going away as an option. As result the __dev* markings will be going away. Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-01-04net/rfkill/rfkill-gpio.c: introduce missing kfreeJulia Lawall
Error handling code following a kmalloc should free the allocated data. The label fail_alloc already does this for rfkill. A simplified version of the semantic match that finds the problem is as follows: (http://coccinelle.lip6.fr) // <smpl> @r exists@ local idexpression x; statement S; identifier f1; position p1,p2; expression *ptr != NULL; @@ x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...); ... if (x == NULL) S <... when != x when != if (...) { <+...x...+> } x->f1 ...> ( return \(0\|<+...x...+>\|ptr\); | return@p2 ...; ) @script:python@ p1 << r.p1; p2 << r.p2; @@ print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-30net: rfkill: convert net/rfkill/* to use module_platform_driver()Axel Lin
This patch converts the drivers in net/rfkill/* to use the module_platform_driver() macro which makes the code smaller and a bit simpler. Cc: "David S. Miller" <davem@davemloft.net> Cc: "John W. Linville" <linville@tuxdriver.com> Cc: Johannes Berg <johannes@sipsolutions.net> Cc: Antonio Ospite <ospite@studenti.unina.it> Cc: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-10-03net:rfkill: add a gpio setup function into GPIO rfkillSangwook Lee
Add a gpio setup function which gives a chance to set up platform specific configuration such as pin multiplexing, input/output direction at the runtime or booting time. Signed-off-by: Sangwook Lee <sangwook.lee@linaro.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-19net: rfkill: add generic gpio rfkill driverRhyland Klein
This adds a new generic gpio rfkill driver to support rfkill switches which are controlled by gpios. The driver also supports passing in data about the clock for the radio, so that when rfkill is blocking, it can disable the clock. This driver assumes platform data is passed from the board files to configure it for specific devices. Original-patch-by: Anantha Idapalapati <aidapalapati@nvidia.com> Signed-off-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>