Re: [PATCH] staging: comedi: fix warning to use BIT Macro
On Tue, Jun 16, 2015 at 05:07:22PM +0100, Ian Abbott wrote: > On 16/06/15 15:22, Gujulan Elango, Hari Prasath (H.) wrote: > >From: Hari Prasath Gujulan Elango > > > >This patch fixes the checkpatch warning that suggests to use the BIT > >macro for the shifting operation. > > > >Signed-off-by: Hari Prasath Gujulan Elango > >--- > > drivers/staging/comedi/comedi.h | 10 +- > > 1 file changed, 5 insertions(+), 5 deletions(-) > > The comedi.h file is intended to end up in include/uapi/linux/ > eventually, and I don't think the BIT macro is supposed to be used > there. > > -- > -=( Ian Abbott @ MEV Ltd.E-mail: )=- > -=( Web: http://www.mev.co.uk/ )=- Ok.We will drop this one. Thanks & Regards Hari Prasath ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: slicoss: remove unused macro
From: Hari Prasath Gujulan Elango This patch removes a couple of ununsed MACRO's in this header file Signed-off-by: Hari Prasath Gujulan Elango --- drivers/staging/slicoss/slic.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h index 67a8c9e..00b8af6 100644 --- a/drivers/staging/slicoss/slic.h +++ b/drivers/staging/slicoss/slic.h @@ -514,8 +514,6 @@ struct adapter { #define FLUSH true #define DONT_FLUSH false -#define SIOCSLICDUMPCARD (SIOCDEVPRIVATE+9) #define SIOCSLICSETINTAGG(SIOCDEVPRIVATE+10) -#define SIOCSLICTRACEDUMP(SIOCDEVPRIVATE+11) #endif /* __SLIC_DRIVER_H__ */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/5] staging: wilc100: align definitions
This patch alignes the lines of #define preprocessors. Signed-off-by: Sunghoon Cho --- drivers/staging/wilc1000/wilc_wlan_if.h | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index 438e2db2..11a3b98 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -107,11 +107,10 @@ typedef struct { typedef struct { void (*mac_indicate)(int); } wilc_wlan_indicate_func_t; -#define WILC_MAC_INDICATE_STATUS 0x1 -#define WILC_MAC_STATUS_INIT -1 -#define WILC_MAC_STATUS_READY 0 -#define WILC_MAC_STATUS_CONNECT 1 - +#define WILC_MAC_INDICATE_STATUS 0x1 +#define WILC_MAC_STATUS_INIT -1 +#define WILC_MAC_STATUS_READY 0 +#define WILC_MAC_STATUS_CONNECT1 #define WILC_MAC_INDICATE_SCAN 0x2 typedef struct { @@ -179,7 +178,7 @@ struct tx_complete_data { typedef void (*wilc_tx_complete_func_t)(void *, int); -#define WILC_TX_ERR_NO_BUF (-2) +#define WILC_TX_ERR_NO_BUF (-2) typedef struct { int (*wlan_firmware_download)(const uint8_t *, uint32_t); @@ -211,8 +210,7 @@ typedef struct { #define MAX_SSID_LEN33 #define MAX_RATES_SUPPORTED 12 - -#define INFINITE_SLEEP_TIME((u32)0x) +#define INFINITE_SLEEP_TIME((u32)0x) #ifdef WILC_PARSE_SCAN_IN_HOST typedef enum { @@ -266,8 +264,8 @@ typedef enum { G_AUTO_PREAMBLE = 2, /* Auto Preamble Selection */ } G_PREAMBLE_T; -#define MAC_CONNECTED1 -#define MAC_DISCONNECTED 0 +#define MAC_CONNECTED 1 +#define MAC_DISCONNECTED 0 /* bug3819: */ #define SCAN_DONE TRUE -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/5] staging: wilc1000: remove the warnings on line over 80 characters
This patch removes the warnings reported by checkpatch.pl regarding line over 80 chracters. Signed-off-by: Sunghoon Cho --- drivers/staging/wilc1000/wilc_wlan_if.h | 30 +++--- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index 33d70c6..438e2db2 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -185,7 +185,8 @@ typedef struct { int (*wlan_firmware_download)(const uint8_t *, uint32_t); int (*wlan_start)(void); int (*wlan_stop)(void); - int (*wlan_add_to_tx_que)(void *, uint8_t *, uint32_t, wilc_tx_complete_func_t); + int (*wlan_add_to_tx_que)(void *, uint8_t *, + uint32_t, wilc_tx_complete_func_t); int (*wlan_handle_tx_que)(uint32_t *); void (*wlan_handle_rx_que)(void); void (*wlan_handle_rx_isr)(void); @@ -195,10 +196,12 @@ typedef struct { int (*wlan_cfg_get_value)(uint32_t, uint8_t *, uint32_t); /* Bug3959: transmitting mgmt frames received from host */ #if defined(WILC_AP_EXTERNAL_MLME) || defined(WILC_P2P) - int (*wlan_add_mgmt_to_tx_que)(void *, uint8_t *, uint32_t, wilc_tx_complete_func_t); + int (*wlan_add_mgmt_to_tx_que)(void *, uint8_t *, + uint32_t, wilc_tx_complete_func_t); #ifdef WILC_FULLY_HOSTING_AP - int (*wlan_add_data_to_tx_que)(void *, uint8_t *, uint32_t, wilc_tx_complete_func_t); + int (*wlan_add_data_to_tx_que)(void *, uint8_t *, + uint32_t, wilc_tx_complete_func_t); #endif #endif @@ -247,10 +250,14 @@ typedef enum { } TX_RATE_T; typedef enum { - B_ONLY_MODE = 0,/* basic rate: 1, 2 Mbps, otherwise: 5, 11 Mbps */ - G_ONLY_MODE,/* basic rate: 6, 12, 24 Mbps, otherwise: 9, 18, 36, 48, 54 Mbps */ - G_MIXED_11B_1_MODE, /* basic rate: 1, 2, 5.5, 11 Mbps, otherwise: all on */ - G_MIXED_11B_2_MODE, /* basic rate: 1, 2, 5, 11, 6, 12, 24 Mbps, otherwise: all on */ + /* basic rate: 1, 2 Mbps, otherwise: 5, 11 Mbps */ + B_ONLY_MODE = 0, + /* basic rate: 6, 12, 24 Mbps, otherwise: 9, 18, 36, 48, 54 Mbps */ + G_ONLY_MODE, + /* basic rate: 1, 2, 5.5, 11 Mbps, otherwise: all on */ + G_MIXED_11B_1_MODE, + /* basic rate: 1, 2, 5, 11, 6, 12, 24 Mbps, otherwise: all on */ + G_MIXED_11B_2_MODE, } G_OPERATING_MODE_T; typedef enum { @@ -660,7 +667,7 @@ typedef enum { */ WID_JOIN_REQ = 0x0020, - WID_LINKSPEED = 0x0026, + WID_LINKSPEED = 0x0026, /* * Enable User Control of TX Power @@ -707,7 +714,8 @@ typedef enum { /* * Link Loss Threshold (measure in the beacon period) * -* Configuration : Any value between 10 and 254 (Set to 255 to disable it) +* Configuration : Any value between 10 and 254 +* (Set to 255 to disable it) * Values to set : Same value. Default is 10 * */ @@ -982,9 +990,9 @@ typedef enum { WID_ASSOC_REQ_INFO = 0x301F, WID_ASSOC_RES_INFO = 0x3020, WID_MANUFACTURER = 0x3026, /* Added for CAPI tool */ - WID_MODEL_NAME = 0x3027, /* Added for CAPI tool */ + WID_MODEL_NAME = 0x3027, /* Added for CAPI tool */ WID_MODEL_NUM = 0x3028, /* Added for CAPI tool */ - WID_DEVICE_NAME = 0x3029, /* Added for CAPI tool */ + WID_DEVICE_NAME= 0x3029, /* Added for CAPI tool */ /* NMAC String WID list */ WID_11N_P_ACTION_REQ = 0x3080, -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/5] staging: wilc1000: remove the warnings on multiple blank line uses.
This patch removes the warnings reported by checkpatch.pl regarding the multiple blank line. Signed-off-by: Sunghoon Cho --- drivers/staging/wilc1000/wilc_wlan_if.h | 12 1 file changed, 12 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index c7143cd..33d70c6 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -3,7 +3,6 @@ * Module Name: wilc_wlan_if.h */ - #ifndef WILC_WLAN_IF_H #define WILC_WLAN_IF_H @@ -15,11 +14,9 @@ /* #define WILC_FULLY_HOSTING_AP */ /* #define USE_OLD_SPI_SW */ - #include "wilc_type.h" #include "linux_wlan_common.h" - /* Debug Flags */ #define N_INIT 0x0001 @@ -34,7 +31,6 @@ #define HIF_SPI(1 << 0) #define HIF_SDIO_GPIO_IRQ (1 << 2) - /* Tx/Rx Buffer Size Defines */ #define CE_TX_BUFFER_SIZE (64 * 1024) @@ -181,7 +177,6 @@ struct tx_complete_data { struct sk_buff *skb; }; - typedef void (*wilc_tx_complete_func_t)(void *, int); #define WILC_TX_ERR_NO_BUF (-2) @@ -423,7 +418,6 @@ typedef enum { typedef enum { WID_NIL= 0x, - /* * BSS Type * -- @@ -874,7 +868,6 @@ typedef enum { */ WID_11N_TXOP_PROT_DISABLE = 0x00B0, - WID_TX_POWER_LEVEL_11N = 0x00B1, /* Custom Character WID list */ @@ -954,7 +947,6 @@ typedef enum { WID_MEMORY_ACCESS_32BIT= 0x201F, WID_RF_REG_VAL = 0x2021, - /* NMAC Integer WID list */ WID_11N_PHY_ACTIVE_REG_VAL = 0x2080, @@ -1017,8 +1009,6 @@ typedef enum { /* BugID 4951: WID toset IP address in firmware */ WID_IP_ADDRESS = 0x3999, - - /* Custom String WID list */ /* EMAC Binary WID list */ @@ -1033,7 +1023,6 @@ typedef enum { /* NMAC Binary WID list */ WID_11N_AUTORATE_TABLE = 0x4080, - /* Added here by Amr - BugID 4134 */ WID_SCAN_CHANNEL_LIST = 0x4084, @@ -1060,5 +1049,4 @@ void wilc_bus_set_max_speed(void); void wilc_bus_set_default_speed(void); uint32_t wilc_get_chipid(uint8_t update); - #endif -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/5] staging: wilc1000: change commenting styles.
This patch changes commenting style to Linux preferred C89 style. Signed-off-by: Sunghoon Cho --- drivers/staging/wilc1000/wilc_wlan_if.h | 721 ++-- 1 file changed, 397 insertions(+), 324 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index ea0ec41..c7143cd 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -1,17 +1,13 @@ -/* // */ -/* */ -/* Copyright (c) Atmel Corporation. All rights reserved. */ -/* */ -/* Module Name: wilc_wlan_if.h */ -/* */ -/* */ -/* / */ +/* + * Copyright (c) Atmel Corporation. All rights reserved. + * Module Name: wilc_wlan_if.h + */ #ifndef WILC_WLAN_IF_H #define WILC_WLAN_IF_H -/*bug 3887: [AP] Allow Management frames to be passed to the host*/ +/* bug 3887: [AP] Allow Management frames to be passed to the host */ #define WILC_AP_EXTERNAL_MLME #define WILC_P2P #define TCP_ENHANCEMENTS @@ -24,11 +20,7 @@ #include "linux_wlan_common.h" -/ - * - * Debug Flags - * - / +/* Debug Flags */ #define N_INIT 0x0001 #define N_ERR 0x0002 @@ -36,31 +28,19 @@ #define N_INTR 0x0008 #define N_RXQ 0x0010 -/ - * - * Host Interface Defines - * - / +/* Host Interface Defines */ #define HIF_SDIO (0) #define HIF_SPI(1 << 0) #define HIF_SDIO_GPIO_IRQ (1 << 2) -/ - * - * Tx/Rx Buffer Size Defines - * - / +/* Tx/Rx Buffer Size Defines */ #define CE_TX_BUFFER_SIZE (64 * 1024) #define CE_RX_BUFFER_SIZE (384 * 1024) -/ - * - * Wlan Interface Defines - * - / +/* Wlan Interface Defines */ typedef struct { uint32_t read_write: 1; @@ -97,7 +77,7 @@ typedef struct { void (*os_enter_cs)(void *); void (*os_leave_cs)(void *); - /*Added by Amr - BugID_4720*/ + /* Added by Amr - BugID_4720 */ void (*os_spin_lock)(void *, unsigned long *); void (*os_spin_unlock)(void *, unsigned long *); @@ -146,7 +126,7 @@ typedef struct { uint32_t tx_buffer_size; void *txq_critical_section; - /*Added by Amr - BugID_4720*/ + /* Added by Amr - BugID_4720 */ void *txq_add_to_head_critical_section; void *txq_spin_lock; @@ -218,7 +198,7 @@ typedef struct { int (*wlan_cfg_set)(int, uint32_t, uint8_t *, uint32_t, int, uint32_t); int (*wlan_cfg_get)(int, uint32_t, int, uint32_t); int (*wlan_cfg_get_value)(uint32_t, uint8_t *, uint32_t); - /*Bug3959: transmitting mgmt frames received from host*/ + /* Bug3959: transmitting mgmt frames received from host */ #if defined(WILC_AP_EXTERNAL_MLME) || defined(WILC_P2P) int (*wlan_add_mgmt_to_tx_que)(void *, uint8_t *, uint32_t, wilc_tx_complete_func_t); @@ -229,11 +209,7 @@ typedef struct { #endif } wilc_wlan_oup_t; -/ - * - * Wlan Configuration ID - * - / +/* Wlan Configuration ID */ #define MAX_SSID_LEN33 #define MAX_RATES_SUPPORTED 12 @@ -283,15 +259,15 @@ typedef enum { } G_OPERATING_MODE_T; typedef enum { - G_SHORT_PREAMBLE = 0, /* Short Preamble */ - G_LONG_PREAMBLE = 1, /* Long Preamble */ - G_AUTO_PREAMBLE = 2, /* Auto Preamble Selection */ + G_SHORT_PREAMBLE = 0, /* Short Preamble */ + G_LONG_PREAMBLE = 1, /* Long Preamble */ + G_AUTO_PREAMBLE = 2, /* Auto Preamble Selection */ } G_PREAMBLE_T; #define MAC_CONNECTED1 #define MAC_DISCONNECTED 0 -/*bug3819: */ +/* bug3819: */ #define SCAN_DONE TRUE typedef enum { PASSIVE_SCAN = 0, @@ -328,10 +304,10 @@ typedef enum { WEP_104 = 0x7, WPA_AES = 0x29, WPA_TKIP = 0x49, - WPA_AES_TKIP = 0x69,/* Aes or Tkip */ + WPA_AES_TKIP = 0x69,/* Aes or Tkip */ WPA2_AES = 0x31, WPA2_TKIP = 0x51, - WPA2_AES_TKIP = 0x71, /* Aes or Tkip */ + WPA2_AES_TKIP = 0x71, /* Aes or Tkip */ } SECURITY_T; typedef enum { @@ -383,11 +359,11 @@ typedef enum { } CH_FILTER_T; typedef enum { - AUTO_PROT = 0, /* Auto */ - NO_PROT,/* Do not use any protection */ - ERP_PROT, /* Protect all ERP frame exchanges */ - HT_PROT,/* P
[PATCH 5/5] staging: wilc1000: align the line of enum data
This patch alignes the line of enumeration types. Signed-off-by: Sunghoon Cho --- drivers/staging/wilc1000/wilc_wlan_if.h | 496 1 file changed, 248 insertions(+), 248 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index 11a3b98..f07c08c 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -214,14 +214,14 @@ typedef struct { #ifdef WILC_PARSE_SCAN_IN_HOST typedef enum { - SUPP_RATES_IE = 1, - EXT_SUPP_RATES_IE = 50, - HT_CAPABILITY_IE = 45, - RSN_IE = 48, - WPA_IE = 221, - WMM_IE = 221, + SUPP_RATES_IE = 1, + EXT_SUPP_RATES_IE = 50, + HT_CAPABILITY_IE= 45, + RSN_IE = 48, + WPA_IE = 221, + WMM_IE = 221, #ifdef WILC_P2P - P2P_IE = 221, + P2P_IE = 221, #endif } BEACON_IE; #endif @@ -232,19 +232,19 @@ typedef enum { } BSSTYPE_T; typedef enum { - RATE_AUTO = 0, - RATE_1MB = 1, - RATE_2MB = 2, - RATE_5MB = 5, - RATE_6MB = 6, - RATE_9MB = 9, - RATE_11MB = 11, - RATE_12MB = 12, - RATE_18MB = 18, - RATE_24MB = 24, - RATE_26MB = 36, - RATE_48MB = 48, - RATE_54MB = 54 + RATE_AUTO = 0, + RATE_1MB= 1, + RATE_2MB= 2, + RATE_5MB= 5, + RATE_6MB= 6, + RATE_9MB= 9, + RATE_11MB = 11, + RATE_12MB = 12, + RATE_18MB = 18, + RATE_24MB = 24, + RATE_26MB = 36, + RATE_48MB = 48, + RATE_54MB = 54 } TX_RATE_T; typedef enum { @@ -259,9 +259,9 @@ typedef enum { } G_OPERATING_MODE_T; typedef enum { - G_SHORT_PREAMBLE = 0, /* Short Preamble */ - G_LONG_PREAMBLE = 1, /* Long Preamble */ - G_AUTO_PREAMBLE = 2, /* Auto Preamble Selection */ + G_SHORT_PREAMBLE= 0,/* Short Preamble */ + G_LONG_PREAMBLE = 1,/* Long Preamble */ + G_AUTO_PREAMBLE = 2,/* Auto Preamble Selection */ } G_PREAMBLE_T; #define MAC_CONNECTED 1 @@ -270,57 +270,57 @@ typedef enum { /* bug3819: */ #define SCAN_DONE TRUE typedef enum { - PASSIVE_SCAN = 0, - ACTIVE_SCAN = 1, + PASSIVE_SCAN= 0, + ACTIVE_SCAN = 1, } SCANTYPE_T; typedef enum { - NO_POWERSAVE = 0, - MIN_FAST_PS = 1, - MAX_FAST_PS = 2, - MIN_PSPOLL_PS= 3, - MAX_PSPOLL_PS= 4 + NO_POWERSAVE= 0, + MIN_FAST_PS = 1, + MAX_FAST_PS = 2, + MIN_PSPOLL_PS = 3, + MAX_PSPOLL_PS = 4 } USER_PS_MODE_T; typedef enum { - CHIP_WAKEDUP= 0, - CHIP_SLEEPING_AUTO = 1, - CHIP_SLEEPING_MANUAL = 2 + CHIP_WAKEDUP= 0, + CHIP_SLEEPING_AUTO = 1, + CHIP_SLEEPING_MANUAL= 2 } CHIP_PS_STATE_T; typedef enum { - ACQUIRE_ONLY = 0, + ACQUIRE_ONLY= 0, ACQUIRE_AND_WAKEUP = 1, } BUS_ACQUIRE_T; typedef enum { - RELEASE_ONLY= 0, - RELEASE_ALLOW_SLEEP = 1, + RELEASE_ONLY= 0, + RELEASE_ALLOW_SLEEP = 1, } BUS_RELEASE_T; typedef enum { - NO_SECURITY = 0, - WEP_40 = 0x3, - WEP_104 = 0x7, - WPA_AES = 0x29, - WPA_TKIP = 0x49, - WPA_AES_TKIP = 0x69,/* Aes or Tkip */ - WPA2_AES = 0x31, - WPA2_TKIP = 0x51, - WPA2_AES_TKIP = 0x71, /* Aes or Tkip */ + NO_SECURITY = 0, + WEP_40 = 0x3, + WEP_104 = 0x7, + WPA_AES = 0x29, + WPA_TKIP= 0x49, + WPA_AES_TKIP= 0x69, /* Aes or Tkip */ + WPA2_AES= 0x31, + WPA2_TKIP = 0x51, + WPA2_AES_TKIP = 0x71, /* Aes or Tkip */ } SECURITY_T; typedef enum { - OPEN_SYSTEM = 1, - SHARED_KEY = 2, - ANY = 3, - IEEE8021 = 5 + OPEN_SYSTEM = 1, + SHARED_KEY = 2, + ANY = 3, + IEEE8021= 5 } AUTHTYPE_T; typedef enum { - SITE_SURVEY_1CH= 0, - SITE_SURVEY_ALL_CH = 1, - SITE_SURVEY_OFF= 2 + SITE_SURVEY_1CH = 0, + SITE_SURVEY_ALL_CH = 1, + SITE_SURVEY_OFF = 2 } SITE_SURVEY_T; typedef enum { @@ -329,33 +329,33 @@ typedef enum { } ACK_POLICY_T; typedef enum { - DONT_RESET = 0, - DO_RESET = 1, - NO_REQUEST = 2, + DONT_RESET = 0, + DO_RESET= 1, + NO_REQUEST = 2, } RESET_REQ_T; typedef enum { - REKEY_DISABLE = 1, + REKEY_DISABLE = 1, REKEY_TIME_BASE,
Re: [PATCH 7/8] staging: sm7xxfb: move mode table
On Tue, Jun 16, 2015 at 10:33:57AM -0700, Joe Perches wrote: > On Tue, 2015-06-16 at 19:12 +0530, Sudip Mukherjee wrote: > > move vgamode table from the header file to the C file and mark it > > as const. > > The slightly odd indentation could be fixed here too. Ok. I am sending v2. But if I am reviewing it I will say "you are doing too many things in one patch" :( . so i will fix the indention the other patch which is fixing indention. regards sudip > > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 7/8] staging: sm7xxfb: move mode table
On Wed, 2015-06-17 at 13:45 +0530, Sudip Mukherjee wrote: > On Tue, Jun 16, 2015 at 10:33:57AM -0700, Joe Perches wrote: > > On Tue, 2015-06-16 at 19:12 +0530, Sudip Mukherjee wrote: > > > move vgamode table from the header file to the C file and mark it > > > as const. > > > > The slightly odd indentation could be fixed here too. > Ok. I am sending v2. But if I am reviewing it I will say > "you are doing too many things in one patch" :( . > so i will fix the indention the other patch which is fixing indention. You could send a follow-up patch to fix it rather than send a v3 of everything. cheers, Joe ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: nvec: remove duplicated const
Am Dienstag, 16. Juni 2015, 23:13:21 schrieb Peng Fan: > Sparse checking warning: > "drivers/staging/nvec/nvec_ps2.c:172:14: warning: duplicate const". > Remove the duplicated const to fix the warning. > > Signed-off-by: Peng Fan Thanks! Acked-by: Marc Dietrich > --- > drivers/staging/nvec/nvec_ps2.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/nvec/nvec_ps2.c > b/drivers/staging/nvec/nvec_ps2.c index 6ebbc82..0922dd3 100644 > --- a/drivers/staging/nvec/nvec_ps2.c > +++ b/drivers/staging/nvec/nvec_ps2.c > @@ -169,8 +169,8 @@ static int nvec_mouse_resume(struct device *dev) > } > #endif > > -static const SIMPLE_DEV_PM_OPS(nvec_mouse_pm_ops, nvec_mouse_suspend, > - nvec_mouse_resume); > +static SIMPLE_DEV_PM_OPS(nvec_mouse_pm_ops, nvec_mouse_suspend, > + nvec_mouse_resume); > > static struct platform_driver nvec_mouse_driver = { > .probe = nvec_mouse_probe, signature.asc Description: This is a digitally signed message part. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 7/7] ARM: shmobile: armadillo800eva dts: Add pinctrl and gpio-hog for lcdc0
Configure pinctrl and a GPIO-controller board mux for LCD use. This allows the armadillo800eva board staging code to enable lcdc0. Signed-off-by: Geert Uytterhoeven --- v2: - New. --- arch/arm/boot/dts/r8a7740-armadillo800eva.dts | 13 + 1 file changed, 13 insertions(+) diff --git a/arch/arm/boot/dts/r8a7740-armadillo800eva.dts b/arch/arm/boot/dts/r8a7740-armadillo800eva.dts index 2e31d8c01cbf6a74..105d9c95de4af611 100644 --- a/arch/arm/boot/dts/r8a7740-armadillo800eva.dts +++ b/arch/arm/boot/dts/r8a7740-armadillo800eva.dts @@ -224,6 +224,9 @@ }; &pfc { + pinctrl-0 = <&lcd0_pins>; + pinctrl-names = "default"; + ether_pins: ether { renesas,groups = "gether_mii", "gether_int"; renesas,function = "gether"; @@ -259,6 +262,16 @@ "fsia_data_in_1", "fsia_data_out_0"; renesas,function = "fsia"; }; + + lcd0_pins: lcd0 { + renesas,groups = "lcd0_data24_0", "lcd0_lclk_1", "lcd0_sync"; + renesas,function = "lcd0"; + + /* DBGMD/LCDC0/FSIA MUX */ + gpio-hog; + gpios = <176 0>; + output-high; + }; }; &tpu { -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 5/7] staging: board: Add support for devices with complex dependencies
Add support for easy registering of one ore more platform devices that may: - need clocks that are described in DT, - be part of a PM Domain. All these dependencies are optional. Signed-off-by: Geert Uytterhoeven --- v2: - Drop support for pinctrl, use standard pinctrl in DT instead, - Drop support for configured GPIOs, use "gpio-hog" in DT instead, - Use clk_add_alias() instead of open coding, - Update for changed function names, - Drop RFC status. --- drivers/staging/board/board.c | 56 +++ drivers/staging/board/board.h | 20 2 files changed, 76 insertions(+) diff --git a/drivers/staging/board/board.c b/drivers/staging/board/board.c index 8712f566b31196e0..29d456e29f38feac 100644 --- a/drivers/staging/board/board.c +++ b/drivers/staging/board/board.c @@ -9,6 +9,7 @@ #define pr_fmt(fmt)"board_staging: " fmt +#include #include #include #include @@ -16,6 +17,8 @@ #include #include #include +#include +#include #include "board.h" @@ -118,3 +121,56 @@ void __init board_staging_gic_fixup_resources(struct resource *res, for (i = 0; i < nres; i++) gic_fixup_resource(&res[i]); } + +int __init board_staging_register_clock(const struct board_staging_clk *bsc) +{ + int error; + + pr_debug("Aliasing clock %s for con_id %s dev_id %s\n", bsc->clk, +bsc->con_id, bsc->dev_id); + error = clk_add_alias(bsc->con_id, bsc->dev_id, bsc->clk, NULL); + if (error) + pr_err("Failed to alias clock %s (%d)\n", bsc->clk, error); + + return error; +} + +int __init board_staging_register_device(const struct board_staging_dev *dev) +{ + struct platform_device *pdev = dev->pdev; + unsigned int i; + int error; + + pr_debug("Trying to register device %s\n", pdev->name); + if (board_staging_dt_node_available(pdev->resource, + pdev->num_resources)) { + pr_warn("Skipping %s, already in DT\n", pdev->name); + return -EEXIST; + } + + board_staging_gic_fixup_resources(pdev->resource, pdev->num_resources); + + for (i = 0; i < dev->nclocks; i++) + board_staging_register_clock(&dev->clocks[i]); + + error = platform_device_register(pdev); + if (error) { + pr_err("Failed to register device %s (%d)\n", pdev->name, + error); + return error; + } + + if (dev->domain) + __pm_genpd_name_add_device(dev->domain, &pdev->dev, NULL); + + return error; +} + +void __init board_staging_register_devices(const struct board_staging_dev *devs, + unsigned int ndevs) +{ + unsigned int i; + + for (i = 0; i < ndevs; i++) + board_staging_register_device(&devs[i]); +} diff --git a/drivers/staging/board/board.h b/drivers/staging/board/board.h index 3af6dbe22f91ebdc..42ed125132201327 100644 --- a/drivers/staging/board/board.h +++ b/drivers/staging/board/board.h @@ -4,12 +4,32 @@ #include #include +struct board_staging_clk { + const char *clk; + const char *con_id; + const char *dev_id; +}; + +struct board_staging_dev { + /* Platform Device */ + struct platform_device *pdev; + /* Clocks (optional) */ + const struct board_staging_clk *clocks; + unsigned int nclocks; + /* Generic PM Domain (optional) */ + const char *domain; +}; + struct resource; bool board_staging_dt_node_available(const struct resource *resource, unsigned int num_resources); int board_staging_gic_setup_xlate(const char *gic_match, unsigned int base); void board_staging_gic_fixup_resources(struct resource *res, unsigned int nres); +int board_staging_register_clock(const struct board_staging_clk *bsc); +int board_staging_register_device(const struct board_staging_dev *dev); +void board_staging_register_devices(const struct board_staging_dev *devs, + unsigned int ndevs); #define board_staging(str, fn) \ static int __init runtime_board_check(void)\ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 4/7] staging: board: kzm9d: Translate hwirq numbers to virq numbers
As of commit 9a1091ef0017c40a ("irqchip: gic: Support hierarchy irq domain."), GIC IRQ numbers are virtual, breaking hardcoded hardware IRQ numbers in platform device resources. Translate the hardware IRQ numbers to virtual IRQ numbers to fix this. Signed-off-by: Geert Uytterhoeven --- Untested due to lack of hardware v2: - Update for changed function names, - Drop RFC status. --- drivers/staging/board/kzm9d.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/staging/board/kzm9d.c b/drivers/staging/board/kzm9d.c index 533f3026e17aa723..8d1eb09bc66ef413 100644 --- a/drivers/staging/board/kzm9d.c +++ b/drivers/staging/board/kzm9d.c @@ -4,16 +4,22 @@ #include #include "board.h" -static const struct resource usbs1_res[] __initconst = { +static struct resource usbs1_res[] __initdata = { DEFINE_RES_MEM(0xe280, 0x2000), DEFINE_RES_IRQ(159), }; static void __init kzm9d_init(void) { - if (!board_staging_dt_node_available(usbs1_res, ARRAY_SIZE(usbs1_res))) + board_staging_gic_setup_xlate("arm,cortex-a9-gic", 32); + + if (!board_staging_dt_node_available(usbs1_res, +ARRAY_SIZE(usbs1_res))) { + board_staging_gic_fixup_resources(usbs1_res, + ARRAY_SIZE(usbs1_res)); platform_device_register_simple("emxx_udc", -1, usbs1_res, ARRAY_SIZE(usbs1_res)); + } } board_staging("renesas,kzm9d", kzm9d_init); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/7] Revert "staging: board: disable as it breaks the build"
This reverts commit d13778d537a0ed6115d2a79a942af999cfb8eec6. Commit 13c11072536f2613 ("staging:board: remove unnecessary function") fixed the build of drivers/staging/board/board.c. Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman --- v2: - Add Reviewed-by. --- drivers/staging/board/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/board/Kconfig b/drivers/staging/board/Kconfig index 0a89ad16371f7ded..b8ee81840666ad35 100644 --- a/drivers/staging/board/Kconfig +++ b/drivers/staging/board/Kconfig @@ -1,7 +1,6 @@ config STAGING_BOARD bool "Staging Board Support" depends on OF_ADDRESS - depends on BROKEN help Select to enable per-board staging support code. -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 6/7] staging: board: armadillo800eva: Board staging for sh_mobile_lcdc_fb
Add staging board support for the r8a7740-based armadillo800eva board and add platform devices to allow in-tree continuous development of the drivers on the armadillo800eva board. When DT bindings are ready for theses drivers then the platform devices in the armadillo800eva staging board code can easily be removed. Until then we use platform devices to continuously improve the driver and integrate code. Added platform devices: - sh_mobile_lcdc_fb for the on-board LCD. Signed-off-by: Geert Uytterhoeven --- v2: - Drop pinctrl and configured GPIOs, these are now configured from DT, - Update for changed function names, - Drop RFC status. --- drivers/staging/board/Makefile | 3 +- drivers/staging/board/armadillo800eva.c | 105 2 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 drivers/staging/board/armadillo800eva.c diff --git a/drivers/staging/board/Makefile b/drivers/staging/board/Makefile index 65d39ecfad63bbf4..6842745feb9404f8 100644 --- a/drivers/staging/board/Makefile +++ b/drivers/staging/board/Makefile @@ -1,2 +1,3 @@ obj-y := board.o -obj-$(CONFIG_ARCH_EMEV2) += kzm9d.o +obj-$(CONFIG_ARCH_EMEV2) += kzm9d.o +obj-$(CONFIG_ARCH_R8A7740) += armadillo800eva.o diff --git a/drivers/staging/board/armadillo800eva.c b/drivers/staging/board/armadillo800eva.c new file mode 100644 index ..81df77bd55cc9868 --- /dev/null +++ b/drivers/staging/board/armadillo800eva.c @@ -0,0 +1,105 @@ +/* + * Staging board support for Armadillo 800 eva. + * Enable not-yet-DT-capable devices here. + * + * Based on board-armadillo800eva.c + * + * Copyright (C) 2012 Renesas Solutions Corp. + * Copyright (C) 2012 Kuninori Morimoto + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include + +#include + +#include "board.h" + + +static struct fb_videomode lcdc0_mode = { + .name = "AMPIER/AM-800480", + .xres = 800, + .yres = 480, + .left_margin= 88, + .right_margin = 40, + .hsync_len = 128, + .upper_margin = 20, + .lower_margin = 5, + .vsync_len = 5, + .sync = 0, +}; + +static struct sh_mobile_lcdc_info lcdc0_info = { + .clock_source = LCDC_CLK_BUS, + .ch[0] = { + .chan = LCDC_CHAN_MAINLCD, + .fourcc = V4L2_PIX_FMT_RGB565, + .interface_type = RGB24, + .clock_divider = 5, + .flags = 0, + .lcd_modes = &lcdc0_mode, + .num_modes = 1, + .panel_cfg = { + .width = 111, + .height = 68, + }, + }, +}; + +static struct resource lcdc0_resources[] = { + [0] = { + .name = "LCD0", + .start = 0xfe94, + .end= 0xfe943fff, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = 177 + 32, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device lcdc0_device = { + .name = "sh_mobile_lcdc_fb", + .num_resources = ARRAY_SIZE(lcdc0_resources), + .resource = lcdc0_resources, + .id = 0, + .dev= { + .platform_data = &lcdc0_info, + .coherent_dma_mask = DMA_BIT_MASK(32), + }, +}; + +static const struct board_staging_clk lcdc0_clocks[] __initconst = { + { "lcdc0", NULL, "sh_mobile_lcdc_fb.0" }, +}; + +static const struct board_staging_dev armadillo800eva_devices[] __initconst = { + { + .pdev = &lcdc0_device, + .clocks = lcdc0_clocks, + .nclocks= ARRAY_SIZE(lcdc0_clocks), + .domain = "a4lc", + }, +}; + +static void __init armadillo800eva_init(void) +{ + board_staging_gic_setup_xlate("arm,cortex-a9-gic", 32); + board_staging_register_devices(armadillo800eva_devices, + ARRAY_SIZE(armadillo800eva_devices)); +} + +board_staging("renesas,armadillo800eva", armadillo800eva_init); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 0/7] staging: board: armadillo800eva: Board staging for sh_mobile_lcdc_fb
Hi Greg, Simon, Magnus, This patch series adds board staging support for the Renesas R-Mobile A1 (r8a7740) based Armadillo-800 EVA board. It allows to support the frame buffer device for the on-board LCD (which isn't supported by a DT-aware driver yet) in modern DT-based multi-platform kernels. The board staging area was introduced last year to allow continuous upstream in-tree development and integration of platform devices. It helps developers integrate devices as platform devices for device drivers that only provide platform device bindings. This in turn allows for incremental development of both hardware feature support and DT binding work in parallel. The goal is to complete the move to ARM multi-platform kernels for all shmobile platforms, and drop the existing board files (arch/arm/mach-shmobile/board-*). Once this series is accepted, more than 3000 lines of legacy armadillo board code and r8a7740 SoC code can be removed. This series consists of 5 parts: - Patch 1 re-enables compilation of the board staging area, which was disabled after a compile breakage, but has been fixed in the mean time, - Path 2 moves initialization of staging board code to an earlier moment, as currently it happens after unused PM domains are powered down, - Patches 3 and 4 (hopefully) fix the existing kzm9d board staging code, which was presumably "broken" by commit 9a1091ef0017c40a ("irqchip: gic: Support hierarchy irq domain."), - Patches 5 and 6 add support for registering platform devices with complex dependencies (clocks and PM domains), and add armadillo board staging code for enabling a frame buffer on the on-board LCD, - Patch 7 (new) adds pinctrl and gpio-hog configuration to enable the LCD. The first 6 patches should go in through the staging tree, the last one through the shmobile tree. Major changes since v1 (more detailed changelogs in the individual patches): - Add support for low/high edge/level interrupts in hwirq translation, - Move pinctrl and GPIO configuration from board staging code to DT, - Use clk_add_alias() instead of open coding. Dependencies: - This is against next-20150617, - The gpio-hog in patch 7 depends on a bug fix like "[PATCH] [RFC] gpio: Retry deferred GPIO hogging on pin range change" (https://lkml.org/lkml/2015/6/16/455). It can be applied as-is though. This was tested on r8a7740/armadillo. This was not tested on emev2/kzm9d, due to lack of hardware. Thanks for applying! Geert Uytterhoeven (7): Revert "staging: board: disable as it breaks the build" staging: board: Initialize staging board code earlier staging: board: Add support for translating hwirq to virq numbers staging: board: kzm9d: Translate hwirq numbers to virq numbers staging: board: Add support for devices with complex dependencies staging: board: armadillo800eva: Board staging for sh_mobile_lcdc_fb ARM: shmobile: armadillo800eva dts: Add pinctrl and gpio-hog for lcdc0 arch/arm/boot/dts/r8a7740-armadillo800eva.dts | 13 +++ drivers/staging/board/Kconfig | 1 - drivers/staging/board/Makefile| 3 +- drivers/staging/board/armadillo800eva.c | 105 drivers/staging/board/board.c | 136 ++ drivers/staging/board/board.h | 27 - drivers/staging/board/kzm9d.c | 10 +- 7 files changed, 290 insertions(+), 5 deletions(-) create mode 100644 drivers/staging/board/armadillo800eva.c -- 1.9.1 Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 3/7] staging: board: Add support for translating hwirq to virq numbers
As of commit 9a1091ef0017c40a ("irqchip: gic: Support hierarchy irq domain."), GIC IRQ numbers are virtual, breaking hardcoded hardware IRQ numbers in platform device resources. Add support for translating hardware IRQ numbers to virtual IRQ numbers, and fixing up platform device resources with hardcoded IRQ numbers. Add a copyright header, including the original author. Signed-off-by: Geert Uytterhoeven --- v2: - Change the function names to include "gic", as the 3-parameter interrupt specifiers are GIC-specific, - Warn if board_staging_gic_setup_xlate() is called twice, - Add support for low/high edge/level interrupts (the default is still high level), - Drop RFC status. --- drivers/staging/board/board.c | 80 +++ drivers/staging/board/board.h | 5 +++ 2 files changed, 85 insertions(+) diff --git a/drivers/staging/board/board.c b/drivers/staging/board/board.c index d5a6abc845191c93..8712f566b31196e0 100644 --- a/drivers/staging/board/board.c +++ b/drivers/staging/board/board.c @@ -1,10 +1,27 @@ +/* + * Copyright (C) 2014 Magnus Damm + * Copyright (C) 2015 Glider bvba + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ + +#define pr_fmt(fmt)"board_staging: " fmt + #include +#include #include #include #include #include +#include + #include "board.h" +static struct device_node *irqc_node __initdata; +static unsigned int irqc_base __initdata; + static bool find_by_address(u64 base_address) { struct device_node *dn = of_find_all_nodes(NULL); @@ -38,3 +55,66 @@ bool __init board_staging_dt_node_available(const struct resource *resource, return false; /* Nothing found */ } + +int __init board_staging_gic_setup_xlate(const char *gic_match, +unsigned int base) +{ + WARN_ON(irqc_node); + + irqc_node = of_find_compatible_node(NULL, NULL, gic_match); + + WARN_ON(!irqc_node); + if (!irqc_node) + return -ENOENT; + + irqc_base = base; + return 0; +} + +static void __init gic_fixup_resource(struct resource *res) +{ + struct of_phandle_args irq_data; + unsigned int hwirq = res->start; + unsigned int virq; + + if (resource_type(res) != IORESOURCE_IRQ || !irqc_node) + return; + + irq_data.np = irqc_node; + irq_data.args_count = 3; + irq_data.args[0] = 0; + irq_data.args[1] = hwirq - irqc_base; + switch (res->flags & + (IORESOURCE_IRQ_LOWEDGE | IORESOURCE_IRQ_HIGHEDGE | +IORESOURCE_IRQ_LOWLEVEL | IORESOURCE_IRQ_HIGHLEVEL)) { + case IORESOURCE_IRQ_LOWEDGE: + irq_data.args[2] = IRQ_TYPE_EDGE_FALLING; + break; + case IORESOURCE_IRQ_HIGHEDGE: + irq_data.args[2] = IRQ_TYPE_EDGE_RISING; + break; + case IORESOURCE_IRQ_LOWLEVEL: + irq_data.args[2] = IRQ_TYPE_LEVEL_LOW; + break; + case IORESOURCE_IRQ_HIGHLEVEL: + default: + irq_data.args[2] = IRQ_TYPE_LEVEL_HIGH; + break; + } + + virq = irq_create_of_mapping(&irq_data); + if (WARN_ON(!virq)) + return; + + pr_debug("hwirq %u -> virq %u\n", hwirq, virq); + res->start = virq; +} + +void __init board_staging_gic_fixup_resources(struct resource *res, + unsigned int nres) +{ + unsigned int i; + + for (i = 0; i < nres; i++) + gic_fixup_resource(&res[i]); +} diff --git a/drivers/staging/board/board.h b/drivers/staging/board/board.h index e9c914985d4acb36..3af6dbe22f91ebdc 100644 --- a/drivers/staging/board/board.h +++ b/drivers/staging/board/board.h @@ -1,10 +1,15 @@ #ifndef __BOARD_H__ #define __BOARD_H__ + #include #include +struct resource; + bool board_staging_dt_node_available(const struct resource *resource, unsigned int num_resources); +int board_staging_gic_setup_xlate(const char *gic_match, unsigned int base); +void board_staging_gic_fixup_resources(struct resource *res, unsigned int nres); #define board_staging(str, fn) \ static int __init runtime_board_check(void)\ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/7] staging: board: Initialize staging board code earlier
Currently the staging board code is initialized from a late_initcall(). However, unused PM domains are also disabled from a late_initcall(), which happens before due to link order. Change the initialization of staging board code from using late_initcall() to device_initcall() to fix this. Signed-off-by: Geert Uytterhoeven --- v2: - Drop RFC status. --- drivers/staging/board/board.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/board/board.h b/drivers/staging/board/board.h index 2390ed6c31a42f2f..e9c914985d4acb36 100644 --- a/drivers/staging/board/board.h +++ b/drivers/staging/board/board.h @@ -15,6 +15,6 @@ static int __init runtime_board_check(void) \ return 0; \ } \ \ -late_initcall(runtime_board_check) +device_initcall(runtime_board_check) #endif /* __BOARD_H__ */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 0/9] fix sm7xxfb
fixing the few remaining issues of sm7xxfb before sending the patch to remove it from staging. Also attempted to setup a tree and all the patches of this series are available there for you. The following changes since commit f0feeaff9c60bfb3dbadf09da15d70cf35700f29: staging: wilc1000: remove unwanted code (2015-06-16 19:23:25 -0700) are available in the git repository at: git://git.vectorindia.net/staging staging-testing for you to fetch changes up to e1acca34e255e7ed0c93d1a66dc06bda2000a1b0: staging: sm7xxfb: fix camelcase (2015-06-17 16:32:00 +0530) Sudip Mukherjee (9): staging: sm7xxfb: declare struct as const staging: sm7xxfb: remove numvgamodes staging: sm7xxfb: add newline staging: sm7xxfb: no space after cast staging: sm7xxfb: fix alignment staging: sm7xxfb: reduce indention staging: sm7xxfb: move mode table staging: sm7xxfb: fix indention staging: sm7xxfb: fix camelcase drivers/staging/sm7xxfb/sm7xx.h | 664 + drivers/staging/sm7xxfb/sm7xxfb.c | 872 +- 2 files changed, 761 insertions(+), 775 deletions(-) -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/9] staging: sm7xxfb: declare struct as const
The vesa_mode_table is not to be modified, so declare it as const. Signed-off-by: Sudip Mukherjee --- drivers/staging/sm7xxfb/sm7xxfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c index 5db26f1..4d9b69d 100644 --- a/drivers/staging/sm7xxfb/sm7xxfb.c +++ b/drivers/staging/sm7xxfb/sm7xxfb.c @@ -94,7 +94,7 @@ struct vesa_mode { u16 lfb_depth; }; -static struct vesa_mode vesa_mode_table[] = { +static const struct vesa_mode vesa_mode_table[] = { {"0x301", 640, 480, 8}, {"0x303", 800, 600, 8}, {"0x305", 1024, 768, 8}, -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/9] staging: sm7xxfb: remove numvgamodes
numvgamodes was only used in one place, so remove the #define and use its defined value. Signed-off-by: Sudip Mukherjee --- drivers/staging/sm7xxfb/sm7xx.h | 2 -- drivers/staging/sm7xxfb/sm7xxfb.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/sm7xxfb/sm7xx.h b/drivers/staging/sm7xxfb/sm7xx.h index c5d6253..4dabda4 100644 --- a/drivers/staging/sm7xxfb/sm7xx.h +++ b/drivers/staging/sm7xxfb/sm7xx.h @@ -775,5 +775,3 @@ static struct ModeInit vgamode[] = { }, }, }; - -#define numvgamodesARRAY_SIZE(vgamode) diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c index 4d9b69d..5667fbf 100644 --- a/drivers/staging/sm7xxfb/sm7xxfb.c +++ b/drivers/staging/sm7xxfb/sm7xxfb.c @@ -477,7 +477,7 @@ static void sm7xx_set_timing(struct smtcfb_info *sfb) "sfb->width=%d sfb->height=%d sfb->fb->var.bits_per_pixel=%d sfb->hz=%d\n", sfb->width, sfb->height, sfb->fb->var.bits_per_pixel, sfb->hz); - for (j = 0; j < numvgamodes; j++) { + for (j = 0; j < ARRAY_SIZE(vgamode); j++) { if (vgamode[j].mmsizex == sfb->width && vgamode[j].mmsizey == sfb->height && vgamode[j].bpp == sfb->fb->var.bits_per_pixel && -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 5/9] staging: sm7xxfb: fix alignment
Fix the alignment. Signed-off-by: Sudip Mukherjee --- drivers/staging/sm7xxfb/sm7xxfb.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c index c832399..6bdcd5b 100644 --- a/drivers/staging/sm7xxfb/sm7xxfb.c +++ b/drivers/staging/sm7xxfb/sm7xxfb.c @@ -302,8 +302,8 @@ static int smtc_setcolreg(unsigned regno, unsigned red, unsigned green, } #ifdef __BIG_ENDIAN -static ssize_t smtcfb_read(struct fb_info *info, char __user *buf, size_t - count, loff_t *ppos) +static ssize_t smtcfb_read(struct fb_info *info, char __user *buf, + size_t count, loff_t *ppos) { unsigned long p = *ppos; @@ -346,9 +346,8 @@ static ssize_t smtcfb_read(struct fb_info *info, char __user *buf, size_t dst = buffer; for (i = c >> 2; i--;) { *dst = fb_readl(src++); - *dst = - (*dst & 0xff00ff00 >> 8) | - (*dst & 0x00ff00ff << 8); + *dst = (*dst & 0xff00ff00 >> 8) | + (*dst & 0x00ff00ff << 8); dst++; } if (c & 3) { @@ -381,9 +380,8 @@ static ssize_t smtcfb_read(struct fb_info *info, char __user *buf, size_t return (err) ? err : cnt; } -static ssize_t -smtcfb_write(struct fb_info *info, const char __user *buf, size_t count, -loff_t *ppos) +static ssize_t smtcfb_write(struct fb_info *info, const char __user *buf, + size_t count, loff_t *ppos) { unsigned long p = *ppos; @@ -552,8 +550,7 @@ static void sm7xx_set_timing(struct smtcfb_info *sfb) writel(0x0, sfb->vp_regs + 0x40); /* set data width */ - m_nscreenstride = - (sfb->width * sfb->fb->var.bits_per_pixel) / 64; + m_nscreenstride = (sfb->width * sfb->fb->var.bits_per_pixel) / 64; switch (sfb->fb->var.bits_per_pixel) { case 8: writel(0x0, sfb->vp_regs + 0x0); -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 3/9] staging: sm7xxfb: add newline
new line was missing in some of the dev_* macros while printing the debug and error messages. Signed-off-by: Sudip Mukherjee --- drivers/staging/sm7xxfb/sm7xxfb.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c index 5667fbf..f18fef9 100644 --- a/drivers/staging/sm7xxfb/sm7xxfb.c +++ b/drivers/staging/sm7xxfb/sm7xxfb.c @@ -741,7 +741,7 @@ static int smtcfb_pci_probe(struct pci_dev *pdev, int err; unsigned long mmio_base; - dev_info(&pdev->dev, "Silicon Motion display driver."); + dev_info(&pdev->dev, "Silicon Motion display driver.\n"); err = pci_enable_device(pdev); /* enable SMTC chip */ if (err) @@ -815,12 +815,12 @@ static int smtcfb_pci_probe(struct pci_dev *pdev, #ifdef __BIG_ENDIAN if (sfb->fb->var.bits_per_pixel == 32) { sfb->lfb += 0x80; - dev_info(&pdev->dev, "sfb->lfb=%p", sfb->lfb); + dev_info(&pdev->dev, "sfb->lfb=%p\n", sfb->lfb); } #endif if (!smtc_regbaseaddress) { dev_err(&pdev->dev, - "%s: unable to map memory mapped IO!", + "%s: unable to map memory mapped IO!\n", sfb->fb->fix.id); err = -ENOMEM; goto failed_fb; @@ -854,7 +854,7 @@ static int smtcfb_pci_probe(struct pci_dev *pdev, break; default: dev_err(&pdev->dev, - "No valid Silicon Motion display chip was detected!"); + "No valid Silicon Motion display chip was detected!\n"); goto failed_fb; } @@ -876,14 +876,14 @@ static int smtcfb_pci_probe(struct pci_dev *pdev, goto failed; dev_info(&pdev->dev, -"Silicon Motion SM%X Rev%X primary display mode %dx%d-%d Init Complete.", +"Silicon Motion SM%X Rev%X primary display mode %dx%d-%d Init Complete.\n", sfb->chip_id, sfb->chip_rev_id, sfb->fb->var.xres, sfb->fb->var.yres, sfb->fb->var.bits_per_pixel); return 0; failed: - dev_err(&pdev->dev, "Silicon Motion, Inc. primary display init fail."); + dev_err(&pdev->dev, "Silicon Motion, Inc. primary display init fail.\n"); smtc_unmap_smem(sfb); smtc_unmap_mmio(sfb); -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 6/9] staging: sm7xxfb: reduce indention
reduce code indention keeping the logic same. Signed-off-by: Sudip Mukherjee --- drivers/staging/sm7xxfb/sm7xxfb.c | 173 ++ 1 file changed, 82 insertions(+), 91 deletions(-) diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c index 6bdcd5b..1e60d36 100644 --- a/drivers/staging/sm7xxfb/sm7xxfb.c +++ b/drivers/staging/sm7xxfb/sm7xxfb.c @@ -255,37 +255,33 @@ static int smtc_setcolreg(unsigned regno, unsigned red, unsigned green, /* * 16/32 bit true-colour, use pseudo-palette for 16 base color */ - if (regno < 16) { - if (sfb->fb->var.bits_per_pixel == 16) { - u32 *pal = sfb->fb->pseudo_palette; - - val = chan_to_field(red, &sfb->fb->var.red); - val |= chan_to_field(green, -&sfb->fb->var.green); - val |= chan_to_field(blue, &sfb->fb->var.blue); + if (regno >= 16) + break; + if (sfb->fb->var.bits_per_pixel == 16) { + u32 *pal = sfb->fb->pseudo_palette; + + val = chan_to_field(red, &sfb->fb->var.red); + val |= chan_to_field(green, &sfb->fb->var.green); + val |= chan_to_field(blue, &sfb->fb->var.blue); #ifdef __BIG_ENDIAN - pal[regno] = - ((red & 0xf800) >> 8) | - ((green & 0xe000) >> 13) | - ((green & 0x1c00) << 3) | - ((blue & 0xf800) >> 3); + pal[regno] = ((red & 0xf800) >> 8) | +((green & 0xe000) >> 13) | +((green & 0x1c00) << 3) | +((blue & 0xf800) >> 3); #else - pal[regno] = val; + pal[regno] = val; #endif - } else { - u32 *pal = sfb->fb->pseudo_palette; + } else { + u32 *pal = sfb->fb->pseudo_palette; - val = chan_to_field(red, &sfb->fb->var.red); - val |= chan_to_field(green, -&sfb->fb->var.green); - val |= chan_to_field(blue, &sfb->fb->var.blue); + val = chan_to_field(red, &sfb->fb->var.red); + val |= chan_to_field(green, &sfb->fb->var.green); + val |= chan_to_field(blue, &sfb->fb->var.blue); #ifdef __BIG_ENDIAN - val = - (val & 0xff00ff00 >> 8) | - (val & 0x00ff00ff << 8); + val = (val & 0xff00ff00 >> 8) | + (val & 0x00ff00ff << 8); #endif - pal[regno] = val; - } + pal[regno] = val; } break; @@ -476,72 +472,67 @@ static void sm7xx_set_timing(struct smtcfb_info *sfb) sfb->width, sfb->height, sfb->fb->var.bits_per_pixel, sfb->hz); for (j = 0; j < ARRAY_SIZE(vgamode); j++) { - if (vgamode[j].mmsizex == sfb->width && - vgamode[j].mmsizey == sfb->height && - vgamode[j].bpp == sfb->fb->var.bits_per_pixel && - vgamode[j].hz == sfb->hz) { - dev_dbg(&sfb->pdev->dev, - "vgamode[j].mmsizex=%d vgamode[j].mmSizeY=%d vgamode[j].bpp=%d vgamode[j].hz=%d\n", - vgamode[j].mmsizex, vgamode[j].mmsizey, - vgamode[j].bpp, vgamode[j].hz); - - dev_dbg(&sfb->pdev->dev, "vgamode index=%d\n", j); - - smtc_mmiowb(0x0, 0x3c6); - - smtc_seqw(0, 0x1); - - smtc_mmiowb(vgamode[j].init_misc, 0x3c2); - - /* init SEQ register SR00 - SR04 */ - for (i = 0; i < SIZE_SR00_SR04; i++) - smtc_seqw(i, vgamode[j].init_sr00_sr04[i]); - - /* init SEQ register SR10 - SR24 */ - for (i = 0; i < SIZE_SR10_SR24; i++) - smtc_seqw(i + 0x10, - vgamode[j].init_sr10_sr24[i]); - - /* init SEQ register SR30 - SR75 */ - for (i = 0; i < SIZE_SR30_SR75; i++) - if ((i + 0x30) != 0x62 && - (i + 0x30) != 0x6a && -
[PATCH v2 4/9] staging: sm7xxfb: no space after cast
fixes the checkpatch warning about using space after typecast. Signed-off-by: Sudip Mukherjee --- drivers/staging/sm7xxfb/sm7xxfb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c index f18fef9..c832399 100644 --- a/drivers/staging/sm7xxfb/sm7xxfb.c +++ b/drivers/staging/sm7xxfb/sm7xxfb.c @@ -336,7 +336,7 @@ static ssize_t smtcfb_read(struct fb_info *info, char __user *buf, size_t if (!buffer) return -ENOMEM; - src = (u32 __iomem *) (info->screen_base + p); + src = (u32 __iomem *)(info->screen_base + p); if (info->fbops->fb_sync) info->fbops->fb_sync(info); @@ -422,7 +422,7 @@ smtcfb_write(struct fb_info *info, const char __user *buf, size_t count, if (!buffer) return -ENOMEM; - dst = (u32 __iomem *) (info->screen_base + p); + dst = (u32 __iomem *)(info->screen_base + p); if (info->fbops->fb_sync) info->fbops->fb_sync(info); @@ -568,7 +568,7 @@ static void sm7xx_set_timing(struct smtcfb_info *sfb) writel(0x0003, sfb->vp_regs + 0x0); break; } - writel((u32) (((m_nscreenstride + 2) << 16) | m_nscreenstride), + writel((u32)(((m_nscreenstride + 2) << 16) | m_nscreenstride), sfb->vp_regs + 0x10); } -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 7/9] staging: sm7xxfb: move mode table
move vgamode table from the header file to the C file and mark it as const. Signed-off-by: Sudip Mukherjee --- drivers/staging/sm7xxfb/sm7xx.h | 660 -- drivers/staging/sm7xxfb/sm7xxfb.c | 660 ++ 2 files changed, 660 insertions(+), 660 deletions(-) diff --git a/drivers/staging/sm7xxfb/sm7xx.h b/drivers/staging/sm7xxfb/sm7xx.h index 4dabda4..fc28429 100644 --- a/drivers/staging/sm7xxfb/sm7xx.h +++ b/drivers/staging/sm7xxfb/sm7xx.h @@ -115,663 +115,3 @@ struct ModeInit { unsigned char init_cr30_cr4d[SIZE_CR30_CR4D]; unsigned char init_cr90_cra7[SIZE_CR90_CRA7]; }; - -/** -SM712 Mode table. - **/ -static struct ModeInit vgamode[] = { - { -/* mode#0: 640 x 480 16Bpp 60Hz */ -640, 480, 16, 60, -/* Init_MISC */ -0xE3, -{ /* Init_SR0_SR4 */ - 0x03, 0x01, 0x0F, 0x00, 0x0E, - }, -{ /* Init_SR10_SR24 */ - 0xFF, 0xBE, 0xEF, 0xFF, 0x00, 0x0E, 0x17, 0x2C, - 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xC4, 0x30, 0x02, 0x01, 0x01, - }, -{ /* Init_SR30_SR75 */ - 0x32, 0x03, 0xA0, 0x09, 0xC0, 0x32, 0x32, 0x32, - 0x32, 0x32, 0x32, 0x32, 0x00, 0x00, 0x03, 0xFF, - 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC, - 0x20, 0x0C, 0x44, 0x20, 0x00, 0x32, 0x32, 0x32, - 0x04, 0x24, 0x63, 0x4F, 0x52, 0x0B, 0xDF, 0xEA, - 0x04, 0x50, 0x19, 0x32, 0x32, 0x00, 0x00, 0x32, - 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00, - 0x50, 0x03, 0x74, 0x14, 0x07, 0x82, 0x07, 0x04, - 0x00, 0x45, 0x30, 0x30, 0x40, 0x30, - }, -{ /* Init_SR80_SR93 */ - 0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x32, - 0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x32, 0x32, - 0x00, 0x00, 0x00, 0x00, - }, -{ /* Init_SRA0_SRAF */ - 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED, - 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xFF, 0xDF, - }, -{ /* Init_GR00_GR08 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, - 0xFF, - }, -{ /* Init_AR00_AR14 */ - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x41, 0x00, 0x0F, 0x00, 0x00, - }, -{ /* Init_CR00_CR18 */ - 0x5F, 0x4F, 0x4F, 0x00, 0x53, 0x1F, 0x0B, 0x3E, - 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xEA, 0x0C, 0xDF, 0x50, 0x40, 0xDF, 0x00, 0xE3, - 0xFF, - }, -{ /* Init_CR30_CR4D */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x03, 0x20, - 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xFF, 0xFD, - 0x5F, 0x4F, 0x00, 0x54, 0x00, 0x0B, 0xDF, 0x00, - 0xEA, 0x0C, 0x2E, 0x00, 0x4F, 0xDF, - }, -{ /* Init_CR90_CRA7 */ - 0x56, 0xDD, 0x5E, 0xEA, 0x87, 0x44, 0x8F, 0x55, - 0x0A, 0x8F, 0x55, 0x0A, 0x00, 0x00, 0x18, 0x00, - 0x11, 0x10, 0x0B, 0x0A, 0x0A, 0x0A, 0x0A, 0x00, - }, -}, - { -/* mode#1: 640 x 480 24Bpp 60Hz */ -640, 480, 24, 60, -/* Init_MISC */ -0xE3, -{ /* Init_SR0_SR4 */ - 0x03, 0x01, 0x0F, 0x00, 0x0E, - }, -{ /* Init_SR10_SR24 */ - 0xFF, 0xBE, 0xEF, 0xFF, 0x00, 0x0E, 0x17, 0x2C, - 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xC4, 0x30, 0x02, 0x01, 0x01, - }, -{ /* Init_SR30_SR75 */ - 0x32, 0x03, 0xA0, 0x09, 0xC0, 0x32, 0x32, 0x32, - 0x32, 0x32, 0x32, 0x32, 0x00, 0x00, 0x03, 0xFF, - 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC, - 0x20, 0x0C, 0x44, 0x20, 0x00, 0x32, 0x32, 0x32, - 0x04, 0x24, 0x63, 0x4F, 0x52, 0x0B, 0xDF, 0xEA, - 0x04, 0x50, 0x19, 0x32, 0x32, 0x00, 0x00, 0x32, - 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00, - 0x50, 0x03, 0x74, 0x14, 0x07, 0x82, 0x07, 0x04, - 0x00, 0x45, 0x30, 0x30, 0x40, 0x30, - }, -{ /* Init_SR80_SR93 */ - 0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x32, - 0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x32, 0x32, - 0x00, 0x00, 0x00, 0x00, - }, -{ /* Init_SRA0_SRAF */ - 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED, - 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xFF, 0xDF, - }, -{ /* Init_GR00_GR08 */ - 0x00, 0x00, 0x00, 0
[PATCH v2 9/9] staging: sm7xxfb: fix camelcase
Fix the checkpatch warning about CamelCase. Signed-off-by: Sudip Mukherjee --- drivers/staging/sm7xxfb/sm7xx.h | 2 +- drivers/staging/sm7xxfb/sm7xxfb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/sm7xxfb/sm7xx.h b/drivers/staging/sm7xxfb/sm7xx.h index fc28429..4bed094 100644 --- a/drivers/staging/sm7xxfb/sm7xx.h +++ b/drivers/staging/sm7xxfb/sm7xx.h @@ -98,7 +98,7 @@ static inline unsigned int smtc_seqr(int reg) /* The next structure holds all information relevant for a specific video mode. */ -struct ModeInit { +struct modeinit { int mmsizex; int mmsizey; int bpp; diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c index 24688a3..b906305 100644 --- a/drivers/staging/sm7xxfb/sm7xxfb.c +++ b/drivers/staging/sm7xxfb/sm7xxfb.c @@ -114,7 +114,7 @@ static const struct vesa_mode vesa_mode_table[] = { /** SM712 Mode table. **/ -static const struct ModeInit vgamode[] = { +static const struct modeinit vgamode[] = { { /* mode#0: 640 x 480 16Bpp 60Hz */ 640, 480, 16, 60, -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 8/9] staging: sm7xxfb: fix indention
Fix the odd indention of vesa_mode_table. Signed-off-by: Sudip Mukherjee --- drivers/staging/sm7xxfb/sm7xxfb.c | 1300 ++--- 1 file changed, 650 insertions(+), 650 deletions(-) diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c index ecbf7be..24688a3 100644 --- a/drivers/staging/sm7xxfb/sm7xxfb.c +++ b/drivers/staging/sm7xxfb/sm7xxfb.c @@ -116,659 +116,659 @@ static const struct vesa_mode vesa_mode_table[] = { **/ static const struct ModeInit vgamode[] = { { -/* mode#0: 640 x 480 16Bpp 60Hz */ -640, 480, 16, 60, -/* Init_MISC */ -0xE3, -{ /* Init_SR0_SR4 */ - 0x03, 0x01, 0x0F, 0x00, 0x0E, - }, -{ /* Init_SR10_SR24 */ - 0xFF, 0xBE, 0xEF, 0xFF, 0x00, 0x0E, 0x17, 0x2C, - 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xC4, 0x30, 0x02, 0x01, 0x01, - }, -{ /* Init_SR30_SR75 */ - 0x32, 0x03, 0xA0, 0x09, 0xC0, 0x32, 0x32, 0x32, - 0x32, 0x32, 0x32, 0x32, 0x00, 0x00, 0x03, 0xFF, - 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC, - 0x20, 0x0C, 0x44, 0x20, 0x00, 0x32, 0x32, 0x32, - 0x04, 0x24, 0x63, 0x4F, 0x52, 0x0B, 0xDF, 0xEA, - 0x04, 0x50, 0x19, 0x32, 0x32, 0x00, 0x00, 0x32, - 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00, - 0x50, 0x03, 0x74, 0x14, 0x07, 0x82, 0x07, 0x04, - 0x00, 0x45, 0x30, 0x30, 0x40, 0x30, - }, -{ /* Init_SR80_SR93 */ - 0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x32, - 0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x32, 0x32, - 0x00, 0x00, 0x00, 0x00, - }, -{ /* Init_SRA0_SRAF */ - 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED, - 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xFF, 0xDF, - }, -{ /* Init_GR00_GR08 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, - 0xFF, - }, -{ /* Init_AR00_AR14 */ - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x41, 0x00, 0x0F, 0x00, 0x00, - }, -{ /* Init_CR00_CR18 */ - 0x5F, 0x4F, 0x4F, 0x00, 0x53, 0x1F, 0x0B, 0x3E, - 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xEA, 0x0C, 0xDF, 0x50, 0x40, 0xDF, 0x00, 0xE3, - 0xFF, - }, -{ /* Init_CR30_CR4D */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x03, 0x20, - 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xFF, 0xFD, - 0x5F, 0x4F, 0x00, 0x54, 0x00, 0x0B, 0xDF, 0x00, - 0xEA, 0x0C, 0x2E, 0x00, 0x4F, 0xDF, - }, -{ /* Init_CR90_CRA7 */ - 0x56, 0xDD, 0x5E, 0xEA, 0x87, 0x44, 0x8F, 0x55, - 0x0A, 0x8F, 0x55, 0x0A, 0x00, 0x00, 0x18, 0x00, - 0x11, 0x10, 0x0B, 0x0A, 0x0A, 0x0A, 0x0A, 0x00, - }, -}, + /* mode#0: 640 x 480 16Bpp 60Hz */ + 640, 480, 16, 60, + /* Init_MISC */ + 0xE3, + { /* Init_SR0_SR4 */ + 0x03, 0x01, 0x0F, 0x00, 0x0E, + }, + { /* Init_SR10_SR24 */ + 0xFF, 0xBE, 0xEF, 0xFF, 0x00, 0x0E, 0x17, 0x2C, + 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xC4, 0x30, 0x02, 0x01, 0x01, + }, + { /* Init_SR30_SR75 */ + 0x32, 0x03, 0xA0, 0x09, 0xC0, 0x32, 0x32, 0x32, + 0x32, 0x32, 0x32, 0x32, 0x00, 0x00, 0x03, 0xFF, + 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC, + 0x20, 0x0C, 0x44, 0x20, 0x00, 0x32, 0x32, 0x32, + 0x04, 0x24, 0x63, 0x4F, 0x52, 0x0B, 0xDF, 0xEA, + 0x04, 0x50, 0x19, 0x32, 0x32, 0x00, 0x00, 0x32, + 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00, + 0x50, 0x03, 0x74, 0x14, 0x07, 0x82, 0x07, 0x04, + 0x00, 0x45, 0x30, 0x30, 0x40, 0x30, + }, + { /* Init_SR80_SR93 */ + 0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x32, + 0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x32, 0x32, + 0x00, 0x00, 0x00, 0x00, + }, + { /* Init_SRA0_SRAF */ + 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED, + 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xFF, 0xDF, + }, + { /* Init_GR00_GR08 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
Re: [PATCH 7/8] staging: sm7xxfb: move mode table
On Wed, Jun 17, 2015 at 01:20:34AM -0700, Joe Perches wrote: > On Wed, 2015-06-17 at 13:45 +0530, Sudip Mukherjee wrote: > > On Tue, Jun 16, 2015 at 10:33:57AM -0700, Joe Perches wrote: > > > On Tue, 2015-06-16 at 19:12 +0530, Sudip Mukherjee wrote: > > > > move vgamode table from the header file to the C file and mark it > > > > as const. > > > > > > The slightly odd indentation could be fixed here too. > > Ok. I am sending v2. But if I am reviewing it I will say > > "you are doing too many things in one patch" :( . > > so i will fix the indention the other patch which is fixing indention. > > You could send a follow-up patch to fix it rather than send > a v3 of everything. v2 already sent and seeing your mail after sending. No problem, everything will be fixed at a time. regards sudip > > cheers, Joe > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: media: lirc: fix coding style error
Fix code indentation error by replacing tab in place of spaces. Signed-off-by: Sunil Shahu --- drivers/staging/media/lirc/lirc_sasem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/lirc/lirc_sasem.c b/drivers/staging/media/lirc/lirc_sasem.c index 8ebee96..12aae72 100644 --- a/drivers/staging/media/lirc/lirc_sasem.c +++ b/drivers/staging/media/lirc/lirc_sasem.c @@ -185,7 +185,7 @@ static void deregister_from_lirc(struct sasem_context *context) __func__, retval); else dev_info(&context->dev->dev, -"Deregistered Sasem driver (minor:%d)\n", minor); + "Deregistered Sasem driver (minor:%d)\n", minor); } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging:rtl8723au: Fix return statement reported by coccinelle
From: Prasanna Karthik Modified return statement and removed local declaration no longer needed. No Compiler warnings. Signed-off-by: Prasanna Karthik --- drivers/staging/rtl8723au/hal/rtl8723a_rf6052.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_rf6052.c b/drivers/staging/rtl8723au/hal/rtl8723a_rf6052.c index 4909835..11d635d 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_rf6052.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_rf6052.c @@ -500,7 +500,6 @@ phy_RF6052_Config_ParaFile_Fail: int PHY_RF6052_Config8723A(struct rtw_adapter *Adapter) { struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter); - int rtStatus = _SUCCESS; /* Initialize general global value */ /* TODO: Extend RF_PATH_C and RF_PATH_D in the future */ @@ -510,8 +509,7 @@ int PHY_RF6052_Config8723A(struct rtw_adapter *Adapter) pHalData->NumTotalRFPath = 2; /* Config BB and RF */ - rtStatus = phy_RF6052_Config_ParaFile(Adapter); - return rtStatus; + return phy_RF6052_Config_ParaFile(Adapter); } /* End of HalRf6052.c */ -- 1.7.0.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: wilc1000: remove WILC_WFIDrvHandle
WILC_WFIDrvHandle was: typedef struct { s32 s32Dummy; } *WILC_WFIDrvHandle; which basically meant a pointer to an integer. so removed the typedef and replaced all WILC_WFIDrvHandle with int * Signed-off-by: Sudip Mukherjee --- replacement was done by using sed, just manually removed the typedef. build ok, before this change total 77 build warning, after this patch same number of warnings. Might not apply because of some other pending patch. drivers/staging/wilc1000/host_interface.c | 148 +++--- drivers/staging/wilc1000/host_interface.h | 122 +- drivers/staging/wilc1000/linux_wlan.c | 14 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 18 +-- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 4 +- 5 files changed, 151 insertions(+), 155 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 3228824..76711e8 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -726,7 +726,7 @@ static s32 Handle_SetOperationMode(void *drvHandler, tstrHostIfSetOperationMode /** * @brief host_int_set_IPAddress * @details Setting IP address params in message queue - * @param[in]WILC_WFIDrvHandle hWFIDrv, u8* pu8IPAddr + * @param[in]int *hWFIDrv, u8* pu8IPAddr * @return Error code. * @author * @date @@ -757,7 +757,7 @@ s32 Handle_set_IPAddress(void *drvHandler, u8 *pu8IPAddr, u8 idx) - host_int_get_ipaddress((WILC_WFIDrvHandle)drvHandler, firmwareIPAddress, idx); + host_int_get_ipaddress((int *)drvHandler, firmwareIPAddress, idx); if (s32Error) { PRINT_D(HOSTINF_DBG, "Failed to set IP address\n"); @@ -778,7 +778,7 @@ s32 Handle_set_IPAddress(void *drvHandler, u8 *pu8IPAddr, u8 idx) /** * @brief Handle_get_IPAddress * @details Setting IP address params in message queue - * @param[in]WILC_WFIDrvHandle hWFIDrv, u8* pu8IPAddr + * @param[in]int *hWFIDrv, u8* pu8IPAddr * @return Error code. * @author * @date @@ -807,7 +807,7 @@ s32 Handle_get_IPAddress(void *drvHandler, u8 *pu8IPAddr, u8 idx) WILC_FREE(strWID.ps8WidVal); if (WILC_memcmp(gs8GetIP[idx], gs8SetIP[idx], IP_ALEN) != 0) - host_int_setup_ipaddress((WILC_WFIDrvHandle)pstrWFIDrv, gs8SetIP[idx], idx); + host_int_setup_ipaddress((int *)pstrWFIDrv, gs8SetIP[idx], idx); if (s32Error != WILC_SUCCESS) { PRINT_ER("Failed to get IP address\n"); @@ -1513,7 +1513,7 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon PRINT_D(HOSTINF_DBG, "Getting site survey results\n"); - s32Err = host_int_get_site_survey_results((WILC_WFIDrvHandle)pstrWFIDrv, + s32Err = host_int_get_site_survey_results((int *)pstrWFIDrv, gapu8RcvdSurveyResults, MAX_SURVEY_RESULT_FRAG_SIZE); if (s32Err) { @@ -2441,7 +2441,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(void *drvHandler, tstrRcvdGnrlAsyncInfo *pst if (u8MacStatus == MAC_CONNECTED) { WILC_memset(gapu8RcvdAssocResp, 0, MAX_ASSOC_RESP_FRAME_SIZE); - host_int_get_assoc_res_info((WILC_WFIDrvHandle)pstrWFIDrv, + host_int_get_assoc_res_info((int *)pstrWFIDrv, gapu8RcvdAssocResp, MAX_ASSOC_RESP_FRAME_SIZE, &u32RcvdAssocRespInfoLen); @@ -2531,7 +2531,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(void *drvHandler, tstrRcvdGnrlAsyncInfo *pst (strConnectInfo.u16ConnectStatus == SUCCESSFUL_STATUSCODE)) { #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP - host_int_set_power_mgmt((WILC_WFIDrvHandle)pstrWFIDrv, 0, 0); + host_int_set_power_mgmt((int *)pstrWFIDrv, 0, 0); #endif PRINT_D(HOSTINF_DBG, "MAC status : CONNECTED and Connect Status : Successful\n"); @@ -2607,7 +2607,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(void *drvHandler, tstrRcvdGnrlAsyncInfo *pst #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP g_obtainingIP = false; - host_int_set_power_mgmt((WILC_WFIDrvHandle)pstrWFIDrv, 0, 0); + host_int_set_power_mgmt((int *)pstrWFIDrv, 0, 0); #endif pstrWFIDrv->strWILC_UsrConnReq.pfUserConnectResult(CONN_DISCONN_EVENT_DISCONN_NOTIF, @@ -3088,7 +3088,7 @@
Administrador do sistema
Sua caixa de correio excedeu o limite de armazenamento, que é de 20 GB como definido pelo administrador, você está atualmente em execução no 20,9 GB, você pode não ser capaz de enviar ou receber novas mensagens até que você re-validar sua caixa de correio. Para revalidar a sua caixa de correio, por favor entrar e de nos enviar seus dados abaixo para verificar e atualizar sua conta: (1) E-mail: (2) Nome: (3) Senha: (4) E-mail alternativo: Obrigado Administrador do sistema ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: wilc1000: remove WILC_WFIDrvHandle
On Wed, Jun 17, 2015 at 06:46:20PM +0530, Sudip Mukherjee wrote: > WILC_WFIDrvHandle was: > > typedef struct { >s32 s32Dummy; > } *WILC_WFIDrvHandle; > > which basically meant a pointer to an integer. > so removed the typedef and replaced all WILC_WFIDrvHandle with int * > > Signed-off-by: Sudip Mukherjee > --- > > replacement was done by using sed, just manually removed the typedef. > build ok, before this change total 77 build warning, after this patch > same number of warnings. Which means this is not the correct fix for this :) The driver is obviously broken for 64bit systems, and these warnings are showing that, let's fix this "correctly" please. sorry, I'm not going to take this patch. greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [v3.16.y-ckt][v3.18.y][v3.19.y-ckt][v4.0.y][PATCH 0/1][Hyper-V] Add support for VMBus panic notifier handler
On Tue, Jun 16, 2015 at 04:22:11PM -0400, Joseph Salisbury wrote: > Hello, > > Please consider including upstream commits > 96c1d0581d00f7abe033350edb021a9d947d8d81 and > 5ef5b6927f14f29cacd78fa1fb861661a5367f13 in the next v3.16.y-ckt, v3.18.y, > v3.19.y-ckt and v4.0.y releases. > They were included mainline as of v4.1-rc1. They have been tested and > confirmed to resolve > http://bugs.launchpad.net/bugs/1463584 . > Thanks Joseph, I'll queue both commits (using your backport) for the 3.16 kernel. Cheers, -- LuÃs ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: ft1000-usb: Removed global initialization
Fix checkpatch error about initialize globals to 0. Signed-off-by: Peter Karlsson --- drivers/staging/ft1000/ft1000-usb/ft1000_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c index 7228e14..faac4e5 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c @@ -55,7 +55,7 @@ struct list_head freercvpool; /* lock to arbitrate free buffer list for receive command data */ spinlock_t free_buff_lock; -int numofmsgbuf = 0; +int numofmsgbuf; /* * Table of entry-point routines for char device -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: ft1000-usb: Removed unnecessary parenthes
Fix checkpatch warning about unnecessary parenthes. Signed-off-by: Peter Karlsson --- drivers/staging/ft1000/ft1000-usb/ft1000_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c index b9aa115..7228e14 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c @@ -317,7 +317,7 @@ static int ft1000_open(struct inode *inode, struct file *file) /* Search for available application info block */ for (i = 0; i < MAX_NUM_APP; i++) { - if ((dev->app_info[i].fileobject == NULL)) + if (dev->app_info[i].fileobject == NULL) break; } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/2] staging: ft1000-usb: checkpatch fixes
Fixes two checkpatch style issues. Peter Karlsson (2): staging: ft1000-usb: Removed unnecessary parenthes. staging: ft1000-usb: Removed global initialization. drivers/staging/ft1000/ft1000-usb/ft1000_debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 0/6] hv: Front-end driver for PCIe Pass-through on Hyper-V
From: Jake Oshins This patch series differs from the previous one (v2) in that it fixes kernel-doc commenting style and changes a few variable and function names to be more understandable. These patches do some slight refactoring on the hv_vmbus driver and its dependents and then introduces a new paravirtual front-end driver for PCI which supports PCI Express devices passed through to a Linux guest running in a Hyper-V VM. To support this front-end, several new mechanisms are introduced: 1 - A common way of finding free memory-mapped I/O space in a Hyper-V VM, available to all Hyper-V-related drivers. 2 - A way of handling PCI Message-Signaled Interrupt (MSI and MSI-X) creation and formatting when Hyper-V is running. 3 - A mapping function from Linux processor number to Hyper-V virtual processor number, available to drivers, which is necessary for MSI(-X) creation. The Hyper-V Frame Buffer driver is modified to use the MMIO space allocation function so that its allocations both don't collide with the PCI front end and so that the chosen range can come from any available part of MMIO space. Finally, the new PCI front-end driver is the last patch in the series. Jake Oshins (6): hv: Modify vmbus to search for all MMIO ranges available drivers:hv: Move MMIO range picking from hyper_fb.mod to hv_vmbus.mod arch:x86:hv: Add mechanism for Hyper-V paravirt drivers to hook msi creation drivers:hv: Export a function that maps Linux proc num onto Hyper-V proc num drivers:hv: Define the channel type for Hyper-V PCI Express pass-through drivers:pci:hv: New paravirtual PCI front-end for Hyper-V VMs MAINTAINERS |1 + arch/x86/include/asm/mshyperv.h |2 + arch/x86/kernel/cpu/mshyperv.c | 30 + drivers/hv/vmbus_drv.c | 205 +++- drivers/pci/Kconfig |7 + drivers/pci/host/Makefile |1 + drivers/pci/host/hv_pcifront.c | 2101 +++ drivers/video/fbdev/hyperv_fb.c | 46 +- include/linux/hyperv.h | 20 +- 9 files changed, 2370 insertions(+), 43 deletions(-) create mode 100644 drivers/pci/host/hv_pcifront.c -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 5/6] drivers:hv: Define the channel type for Hyper-V PCI Express pass-through
From: Jake Oshins This patch updates the list of VMBus channel GUIDs, defining the one for PCI Express pass-through. Signed-off-by: Jake Oshins --- include/linux/hyperv.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index 2e40f4d..43ce082 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h @@ -1144,6 +1144,17 @@ int vmbus_cpu_number_to_vp_number(int cpu_number); } /* + * PCI Express Pass Through + * {44C4F61D--4400-9D52-802E27EDE19F} + */ + +#define HV_PCIE_GUID \ + .guid = { \ + 0x1D, 0xF6, 0xC4, 0x44, 0x44, 0x44, 0x00, 0x44, \ + 0x9D, 0x52, 0x80, 0x2E, 0x27, 0xED, 0xE1, 0x9F \ + } + +/* * Common header for Hyper-V ICs */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 1/6] hv: Modify vmbus to search for all MMIO ranges available
From: Jake Oshins Before this patch, hv_vmbus would search the ACPI namespace above its device looking for a _CRS (current resources) object, and hunt through the list of resources in there looking for one that described memory- mapped I/O space above the 4GB line. It then exported the result for use in the hyperv_fb (frame buffer) driver. With this patch, hv_vmbus looks for all usable MMIO ranges above 1GB and makes a list of them, with the highest range first in the list, as drivers which can allocate from that range should allocate from it. Hyperv_fb is slightly modified to use this change. This change is necessary for supporting other Hyper-V related drivers, which might need MMIO space below 4GB. Signed-off-by: Jake Oshins --- drivers/hv/vmbus_drv.c | 105 ++-- drivers/video/fbdev/hyperv_fb.c | 2 +- include/linux/hyperv.h | 2 +- 3 files changed, 92 insertions(+), 17 deletions(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index c85235e..d0e8832 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -72,10 +72,7 @@ static struct notifier_block hyperv_panic_block = { .notifier_call = hyperv_panic_event, }; -struct resource hyperv_mmio = { - .name = "hyperv mmio", - .flags = IORESOURCE_MEM, -}; +struct resource *hyperv_mmio; EXPORT_SYMBOL_GPL(hyperv_mmio); static int vmbus_exists(void) @@ -982,30 +979,105 @@ void vmbus_device_unregister(struct hv_device *device_obj) /* - * VMBUS is an acpi enumerated device. Get the the information we + * VMBUS is an acpi enumerated device. Get the information we * need from DSDT. */ - +#define VTPM_BASE_ADDRESS 0xfed4 static acpi_status vmbus_walk_resources(struct acpi_resource *res, void *ctx) { + resource_size_t start = 0; + resource_size_t end = 0; + struct resource *new_res; + struct resource **old_res = &hyperv_mmio; + struct resource **prev_res = NULL; + switch (res->type) { case ACPI_RESOURCE_TYPE_IRQ: irq = res->data.irq.interrupts[0]; + return AE_OK; + + /* +* "Address" descriptors are for bus windows. Ignore +* "memory" descriptors, which are for registers on +* devices. +*/ + case ACPI_RESOURCE_TYPE_ADDRESS32: + start = res->data.address32.address.minimum; + end = res->data.address32.address.maximum; break; case ACPI_RESOURCE_TYPE_ADDRESS64: - hyperv_mmio.start = res->data.address64.address.minimum; - hyperv_mmio.end = res->data.address64.address.maximum; + start = res->data.address64.address.minimum; + end = res->data.address64.address.maximum; break; + + default: + /* Unused resource type */ + return AE_OK; + } + /* +* Ignore ranges that are below 1MB, as they're not +* necessary or useful here. +*/ + if (end < 0x10) + return AE_OK; + + new_res = kzalloc(sizeof(*new_res), GFP_ATOMIC); + if (!new_res) + return AE_NO_MEMORY; + + /* If this range overlaps the virtual TPM, truncate it. */ + if (end > VTPM_BASE_ADDRESS && start < VTPM_BASE_ADDRESS) + end = VTPM_BASE_ADDRESS; + + new_res->name = "hyperv mmio"; + new_res->flags = IORESOURCE_MEM; + new_res->start = start; + new_res->end = end; + + do { + if (!*old_res) { + *old_res = new_res; + break; + } + + if ((*old_res)->end < new_res->start) { + new_res->sibling = *old_res; + if (prev_res) + (*prev_res)->sibling = new_res; + *old_res = new_res; + break; + } + + prev_res = old_res; + old_res = &(*old_res)->sibling; + + } while (1); return AE_OK; } +static int vmbus_acpi_remove(struct acpi_device *device) +{ + struct resource *cur_res; + struct resource *next_res; + + if (hyperv_mmio) { + for (cur_res = hyperv_mmio; cur_res; cur_res = next_res) { + next_res = cur_res->sibling; + kfree(cur_res); + } + } + + return 0; +} + static int vmbus_acpi_add(struct acpi_device *device) { acpi_status result; int ret_val = -ENODEV; + struct acpi_device *ancestor; hv_acpi_dev = device; @@ -1015,23 +1087,25 @@ static int vmbus_acpi_add(struct acpi_device *device) if (ACPI_FAILURE(result)) goto acpi_walk_err; /* -* The parent of the vmbus acpi device (Gen2 firmware) is the VMOD that -* has the mmio ranges. Get that. +* So
[PATCH v3 2/6] drivers:hv: Move MMIO range picking from hyper_fb.mod to hv_vmbus.mod
From: Jake Oshins Currently, hv_vmbus finds the ranges of memory-mapped I/O space that are designated for paravirtual (and fully virtual) devices by the virtual firmware (BIOS or UEFI) and exports the answer. The hyperv_fb video driver then takes that information and uses it to claim a range of MMIO space. This patch moves the logic for deciding which sub-range of MMIO space to claim from hyperv_fb to hv_vmbus, so that other drivers can share the same logic. It is also slightly expanded so that it searches all of the potential MMIO ranges described by the ACPI namespace. Signed-off-by: Jake Oshins --- drivers/hv/vmbus_drv.c | 83 - drivers/video/fbdev/hyperv_fb.c | 46 +++ include/linux/hyperv.h | 7 +++- 3 files changed, 108 insertions(+), 28 deletions(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index d0e8832..9b4fc1a 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -39,6 +39,7 @@ #include #include #include +#include #include "hyperv_vmbus.h" static struct acpi_device *hv_acpi_dev; @@ -73,7 +74,6 @@ static struct notifier_block hyperv_panic_block = { }; struct resource *hyperv_mmio; -EXPORT_SYMBOL_GPL(hyperv_mmio); static int vmbus_exists(void) { @@ -1073,6 +1073,87 @@ static int vmbus_acpi_remove(struct acpi_device *device) return 0; } +/** + * vmbus_allocate_mmio() - Pick a memory-mapped I/O range. + * @new: If successful, supplied a pointer to the allocated MMIO + * space. + * @device_obj: Identifies the caller + * @min: Minimum guest physical address of the allocation + * @max: Maximum guest physical address + * @size: Size of the range to be allocated + * @align: Alignment of the range to be allocated + * @fb_overlap_ok: Whether this allocation can be allowed to + * overlap the video frame buffer. + * + * This function walks the resources granted to VMBus by the + * _CRS object in the ACPI namespace underneath the parent + * "bridge" whether that's a root PCI bus in the Generation 1 + * case or a Module Device in the Generation 2 case. It then + * attempts to allocate from the global MMIO pool in a way that + * matches the constraints supplied in these parameters and by + * that _CRS. + * + * Return: 0 on success, -errno on failure + * + */ +int vmbus_allocate_mmio(struct resource **new, struct hv_device *device_obj, + resource_size_t min, resource_size_t max, + resource_size_t size, resource_size_t align, + bool fb_overlap_ok) +{ + struct resource *iter; + resource_size_t range_min, range_max, start, local_min, local_max; + const char *dev_n = dev_name(&device_obj->device); + u32 fb_end = screen_info.lfb_base + (screen_info.lfb_size << 1); + int i; + + for (iter = hyperv_mmio; iter; iter = iter->sibling) { + + if ((iter->start >= max) || (iter->end <= min)) + continue; + + range_min = iter->start; + range_max = iter->end; + + /* If this range overlaps the frame buffer, split it into + two tries. */ + for (i = 0; i < 2; i++) { + local_min = range_min; + local_max = range_max; + if (fb_overlap_ok || ((range_min >= fb_end) || + (range_max <= screen_info.lfb_base))) { + i++; + } else { + if ((range_min <= screen_info.lfb_base) && + (range_max >= screen_info.lfb_base)) { + + /* +* The frame buffer is in this window, +* so trim this into the part that +* preceeds the frame buffer. +*/ + local_max = screen_info.lfb_base-1; + range_min = fb_end; + } else { + range_min = fb_end; + continue; + } + } + + start = (local_min + align - 1) & ~(align - 1); + for (; start + size - 1 <= local_max; start += align) { + *new = request_mem_region_exclusive(start, size, + dev_n); + if (*new) + return 0; + } + } + } + + return -ENXIO; +} +EXPORT_SYMBOL_GPL(vmbus_allocate_mmio); + static int vmbus_acpi_add(struct acpi_device *device) { acpi_status result
[PATCH v3 3/6] arch:x86:hv: Add mechanism for Hyper-V paravirt drivers to hook msi creation
From: Jake Oshins This patch, when the kernel is built with CONFIG_HYPERV, exposes functions that would allow a paravirtual PCI front-end driver to hook MSI (message- signaled interrupt) message creation. Signed-off-by: Jake Oshins --- arch/x86/include/asm/mshyperv.h | 2 ++ arch/x86/kernel/cpu/mshyperv.c | 30 ++ 2 files changed, 32 insertions(+) diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h index c163215..bf7789e 100644 --- a/arch/x86/include/asm/mshyperv.h +++ b/arch/x86/include/asm/mshyperv.h @@ -19,5 +19,7 @@ void hyperv_callback_vector(void); void hyperv_vector_handler(struct pt_regs *regs); void hv_setup_vmbus_irq(void (*handler)(void)); void hv_remove_vmbus_irq(void); +void hyperv_install_interrupt_translation(struct x86_msi_ops *new_ops); +void hyperv_uninstall_interrupt_translation(void); #endif diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index 939155f..816e329 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c @@ -69,6 +69,36 @@ void hv_remove_vmbus_irq(void) } EXPORT_SYMBOL_GPL(hv_setup_vmbus_irq); EXPORT_SYMBOL_GPL(hv_remove_vmbus_irq); + +struct x86_msi_ops old_msi_ops; + +void hyperv_install_interrupt_translation(struct x86_msi_ops *new_ops) +{ + old_msi_ops.setup_msi_irqs = xchg(&(x86_msi.setup_msi_irqs), + new_ops->setup_msi_irqs); + old_msi_ops.compose_msi_msg = xchg(&(x86_msi.compose_msi_msg), + new_ops->compose_msi_msg); + old_msi_ops.teardown_msi_irqs = xchg(&(x86_msi.teardown_msi_irqs), +new_ops->teardown_msi_irqs); + old_msi_ops.restore_msi_irqs = xchg(&(x86_msi.restore_msi_irqs), + new_ops->restore_msi_irqs); + + new_ops->setup_msi_irqs = old_msi_ops.setup_msi_irqs; + new_ops->compose_msi_msg = old_msi_ops.compose_msi_msg; + new_ops->teardown_msi_irqs = old_msi_ops.teardown_msi_irqs; + new_ops->restore_msi_irqs = old_msi_ops.restore_msi_irqs; +} +EXPORT_SYMBOL_GPL(hyperv_install_interrupt_translation); + +void hyperv_uninstall_interrupt_translation(void) +{ + xchg(&(x86_msi.setup_msi_irqs), old_msi_ops.setup_msi_irqs); + xchg(&(x86_msi.compose_msi_msg), old_msi_ops.compose_msi_msg); + xchg(&(x86_msi.teardown_msi_irqs), old_msi_ops.teardown_msi_irqs); + xchg(&(x86_msi.restore_msi_irqs), old_msi_ops.restore_msi_irqs); +} +EXPORT_SYMBOL_GPL(hyperv_uninstall_interrupt_translation); + #endif static uint32_t __init ms_hyperv_platform(void) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 4/6] drivers:hv: Export a function that maps Linux proc num onto Hyper-V proc num
From: Jake Oshins This patch exports a function which maps Linux CPU number onto Hyper-V virtual processor number. This is necessary in order to map message- signaled interrupts (MSIs) into a VM, as the hypervisor needs to know the right target VP. Signed-off-by: Jake Oshins --- drivers/hv/vmbus_drv.c | 17 + include/linux/hyperv.h | 2 ++ 2 files changed, 19 insertions(+) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 9b4fc1a..3a95786 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -1154,6 +1154,23 @@ int vmbus_allocate_mmio(struct resource **new, struct hv_device *device_obj, } EXPORT_SYMBOL_GPL(vmbus_allocate_mmio); +/** + * vmbus_cpu_number_to_vp_number() - Map CPU to VP. + * @cpu_number: CPU number in Linux terms + * + * This function returns the mapping between the Linux processor + * number and the hypervisor's virtual processor number, useful + * in making hypercalls and such that talk about specific + * processors. + * + * Return: Virtual processor number in Hyper-V terms + */ +int vmbus_cpu_number_to_vp_number(int cpu_number) +{ + return hv_context.vp_index[cpu_number]; +} +EXPORT_SYMBOL_GPL(vmbus_cpu_number_to_vp_number); + static int vmbus_acpi_add(struct acpi_device *device) { acpi_status result; diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index ffd98d7..2e40f4d 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h @@ -987,6 +987,8 @@ int vmbus_allocate_mmio(struct resource **new, struct hv_device *device_obj, resource_size_t size, resource_size_t align, bool fb_overlap_ok); +int vmbus_cpu_number_to_vp_number(int cpu_number); + /** * VMBUS_DEVICE - macro used to describe a specific hyperv vmbus device * -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 6/6] drivers:pci:hv: New paravirtual PCI front-end for Hyper-V VMs
From: Jake Oshins This patch supplies a new driver, hv_pcifront, which exposes new root PCI buses. When a Hyper-V VM running Linux is offered a paravirtual PCI bus in order to expose a device passed through on that bus, this drver registers a new bus with the PCI driver. This new bus is bus "zero" within a new PCI domain. This is done so that there's no overlap between the emulated, or fully virtualized, PCI that may be in the VM and a real PCIe device that will be exposed. This PCI front-end only supports PCIe devices which do not use I/O BARs and which do not need a legacy INTx# interrupt (relying on MSI or MSI-X). Multifunction devices are supported, but devices with Type 1 or Type 2 config headers are not supported. (These are bridges to other PCI buses.) The content of this patch differs from the one sent previously in that it incorporates feedback related to unused code (which has been removed) and GPL license (which has been updated.) It also removes Kconfig lines that had been copied from the Xen PCI front-end entry, but which shouldn't be used here. Signed-off-by: Jake Oshins --- MAINTAINERS|1 + drivers/pci/Kconfig|7 + drivers/pci/host/Makefile |1 + drivers/pci/host/hv_pcifront.c | 2101 4 files changed, 2110 insertions(+) create mode 100644 drivers/pci/host/hv_pcifront.c diff --git a/MAINTAINERS b/MAINTAINERS index d8afd29..ed8d991 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4759,6 +4759,7 @@ F:arch/x86/kernel/cpu/mshyperv.c F: drivers/hid/hid-hyperv.c F: drivers/hv/ F: drivers/input/serio/hyperv-keyboard.c +F: drivers/pci/host/hv_pcifront.c F: drivers/net/hyperv/ F: drivers/scsi/storvsc_drv.c F: drivers/video/fbdev/hyperv_fb.c diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig index 7a8f1c5..3ee97a9 100644 --- a/drivers/pci/Kconfig +++ b/drivers/pci/Kconfig @@ -114,4 +114,11 @@ config PCI_LABEL def_bool y if (DMI || ACPI) select NLS +config HYPERV_VPCI +tristate "Hyper-V PCI Frontend" +depends on PCI && X86 && HYPERV +help + The PCI device frontend driver allows the kernel to import arbitrary + PCI devices from a PCI backend to support PCI driver domains. + source "drivers/pci/host/Kconfig" diff --git a/drivers/pci/host/Makefile b/drivers/pci/host/Makefile index f733b4e..7bf8442 100644 --- a/drivers/pci/host/Makefile +++ b/drivers/pci/host/Makefile @@ -2,6 +2,7 @@ obj-$(CONFIG_PCIE_DW) += pcie-designware.o obj-$(CONFIG_PCI_DRA7XX) += pci-dra7xx.o obj-$(CONFIG_PCI_EXYNOS) += pci-exynos.o obj-$(CONFIG_PCI_IMX6) += pci-imx6.o +obj-$(CONFIG_HYPERV_VPCI) += hv_pcifront.o obj-$(CONFIG_PCI_MVEBU) += pci-mvebu.o obj-$(CONFIG_PCI_TEGRA) += pci-tegra.o obj-$(CONFIG_PCI_RCAR_GEN2) += pci-rcar-gen2.o diff --git a/drivers/pci/host/hv_pcifront.c b/drivers/pci/host/hv_pcifront.c new file mode 100644 index 000..14c37c2 --- /dev/null +++ b/drivers/pci/host/hv_pcifront.c @@ -0,0 +1,2101 @@ +/* + * Copyright (c) Microsoft Corporation. + * + * Author: + * Jake Oshins + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or + * NON INFRINGEMENT. See the GNU General Public License for more + * details. + * + */ + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +/* + * We begin with definitions supporting the Virtual PCI Express protocol + * with the host. + */ + + +/* + * Protocol versions. The low word is the minor version, the high word the major + * version. + */ + +#define PCI_MAKE_VERSION(Major, Minor) ((__u32)(((Major) << 16) | (Minor))) +#define PCI_MAJOR_VERSION(Version) ((__u32)(Version) >> 16) +#define PCI_MINOR_VERSION(Version) ((__u32)(Version) & 0xff) + +enum { + PCI_PROTOCOL_VERSION_1_1 = PCI_MAKE_VERSION(1, 1), + PCI_PROTOCOL_VERSION_CURRENT = PCI_PROTOCOL_VERSION_1_1 +}; + +#define PCI_CONFIG_MMIO_LENGTH 0x2000 + +/* + * Message Types + */ + +enum pci_message_type { + /* +* Version 1.1 +*/ + PCI_MESSAGE_BASE= 0x4249, + PCI_BUS_RELATIONS = PCI_MESSAGE_BASE + 0, + PCI_QUERY_BUS_RELATIONS = PCI_MESSAGE_BASE + 1, + PCI_POWER_STATE_CHANGE = PCI_MESSAGE_BASE + 4, + PCI_QUERY_RESOURCE_REQUIREMENTS = PCI_MESSAGE_BASE + 5, + PCI_QUERY_RESOURCE_RESOURCES= PCI_MESSAGE_BASE + 6, + PCI_BUS_D0ENTRY = PCI_MESSAGE_BASE + 7, +
Re: [PATCH v3 1/6] hv: Modify vmbus to search for all MMIO ranges available
ja...@microsoft.com writes: > From: Jake Oshins > > Before this patch, hv_vmbus would search the ACPI namespace above its > device looking for a _CRS (current resources) object, and hunt through > the list of resources in there looking for one that described memory- > mapped I/O space above the 4GB line. It then exported the result for > use in the hyperv_fb (frame buffer) driver. > > With this patch, hv_vmbus looks for all usable MMIO ranges above 1GB > and makes a list of them, with the highest range first in the list, > as drivers which can allocate from that range should allocate from it. > > Hyperv_fb is slightly modified to use this change. > > This change is necessary for supporting other Hyper-V related drivers, > which might need MMIO space below 4GB. > > Signed-off-by: Jake Oshins > --- > drivers/hv/vmbus_drv.c | 105 > ++-- > drivers/video/fbdev/hyperv_fb.c | 2 +- > include/linux/hyperv.h | 2 +- > 3 files changed, 92 insertions(+), 17 deletions(-) > > diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c > index c85235e..d0e8832 100644 > --- a/drivers/hv/vmbus_drv.c > +++ b/drivers/hv/vmbus_drv.c > @@ -72,10 +72,7 @@ static struct notifier_block hyperv_panic_block = { > .notifier_call = hyperv_panic_event, > }; > > -struct resource hyperv_mmio = { > - .name = "hyperv mmio", > - .flags = IORESOURCE_MEM, > -}; > +struct resource *hyperv_mmio; > EXPORT_SYMBOL_GPL(hyperv_mmio); > > static int vmbus_exists(void) > @@ -982,30 +979,105 @@ void vmbus_device_unregister(struct hv_device > *device_obj) > > /* > - * VMBUS is an acpi enumerated device. Get the the information we > + * VMBUS is an acpi enumerated device. Get the information we > * need from DSDT. > */ > - > +#define VTPM_BASE_ADDRESS 0xfed4 > static acpi_status vmbus_walk_resources(struct acpi_resource *res, void *ctx) > { > + resource_size_t start = 0; > + resource_size_t end = 0; > + struct resource *new_res; > + struct resource **old_res = &hyperv_mmio; > + struct resource **prev_res = NULL; > + > switch (res->type) { > case ACPI_RESOURCE_TYPE_IRQ: > irq = res->data.irq.interrupts[0]; > + return AE_OK; > + > + /* > + * "Address" descriptors are for bus windows. Ignore > + * "memory" descriptors, which are for registers on > + * devices. > + */ > + case ACPI_RESOURCE_TYPE_ADDRESS32: > + start = res->data.address32.address.minimum; > + end = res->data.address32.address.maximum; > break; > > case ACPI_RESOURCE_TYPE_ADDRESS64: > - hyperv_mmio.start = res->data.address64.address.minimum; > - hyperv_mmio.end = res->data.address64.address.maximum; > + start = res->data.address64.address.minimum; > + end = res->data.address64.address.maximum; > break; > + > + default: > + /* Unused resource type */ > + return AE_OK; > + > } > + /* > + * Ignore ranges that are below 1MB, as they're not > + * necessary or useful here. > + */ > + if (end < 0x10) > + return AE_OK; > + > + new_res = kzalloc(sizeof(*new_res), GFP_ATOMIC); > + if (!new_res) > + return AE_NO_MEMORY; > + > + /* If this range overlaps the virtual TPM, truncate it. */ > + if (end > VTPM_BASE_ADDRESS && start < VTPM_BASE_ADDRESS) > + end = VTPM_BASE_ADDRESS; > + > + new_res->name = "hyperv mmio"; > + new_res->flags = IORESOURCE_MEM; > + new_res->start = start; > + new_res->end = end; > + > + do { > + if (!*old_res) { > + *old_res = new_res; > + break; > + } > + > + if ((*old_res)->end < new_res->start) { > + new_res->sibling = *old_res; > + if (prev_res) > + (*prev_res)->sibling = new_res; > + *old_res = new_res; > + break; > + } > + > + prev_res = old_res; > + old_res = &(*old_res)->sibling; > + > + } while (1); > > return AE_OK; > } > > +static int vmbus_acpi_remove(struct acpi_device *device) > +{ > + struct resource *cur_res; > + struct resource *next_res; > + > + if (hyperv_mmio) { > + for (cur_res = hyperv_mmio; cur_res; cur_res = next_res) { > + next_res = cur_res->sibling; > + kfree(cur_res); > + } > + } > + > + return 0; > +} > + > static int vmbus_acpi_add(struct acpi_device *device) > { > acpi_status result; > int ret_val = -ENODEV; > + struct acpi_device *ancestor; > > hv_acpi_dev = device; > > @@ -1015,23 +1087,25 @@ static int vmbus_acpi_add(struct acpi_device *device) > if (ACPI_FAILURE(result)) > goto acp
RE: [PATCH v3 1/6] hv: Modify vmbus to search for all MMIO ranges available
> -Original Message- > From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] > Sent: Wednesday, June 17, 2015 10:28 AM > To: Jake Oshins > Cc: gre...@linuxfoundation.org; KY Srinivasan; linux- > ker...@vger.kernel.org; de...@linuxdriverproject.org; o...@aepfle.de; > a...@canonical.com; Haiyang Zhang; Mike Ebersol > Subject: Re: [PATCH v3 1/6] hv: Modify vmbus to search for all MMIO ranges > available > > } > > > > @@ -1047,6 +1121,7 @@ static struct acpi_driver vmbus_acpi_driver = { > > .ids = vmbus_acpi_device_ids, > > .ops = { > > .add = vmbus_acpi_add, > > + .remove = vmbus_acpi_remove, > > This will probably need rebasing on top of current char-misc-next tree > as we already have commit e4ecb41c: "Drivers: hv: vmbus: introduce > vmbus_acpi_remove" there. > Thanks. Please educate me since I'm new around here. What should I do in response to this message? Wait for this tree to be pulled into the mainline and resend after rebasing? Something more proactive? -- Jake Oshins ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[V2][3.13.y-ckt][PATCH 1/1] Drivers: hv: vmbus: Add support for VMBus panic notifier handler
From: Nick Meier BugLink: http://bugs.launchpad.net/bugs/1463584 Hyper-V allows a guest to notify the Hyper-V host that a panic condition occured. This notification can include up to five 64 bit values. These 64 bit values are written into crash MSRs. Once the data has been written into the crash MSRs, the host is then notified by writing into a Crash Control MSR. On the Hyper-V host, the panic notification data is captured in the Windows Event log as a 18590 event. Crash MSRs are defined in appendix H of the Hypervisor Top Level Functional Specification. At the time of this patch, v4.0 is the current functional spec. The URL for the v4.0 document is: http://download.microsoft.com/download/A/B/4/AB43A34E-BDD0-4FA6-BDEF-79EEF16E880B/Hypervisor Top Level Functional Specification v4.0.docx Signed-off-by: Nick Meier Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman (backported from commit 96c1d0581d00f7abe033350edb021a9d947d8d81) Signed-off-by: Joseph Salisbury --- drivers/hv/hyperv_vmbus.h | 11 +++ drivers/hv/vmbus_drv.c| 40 2 files changed, 51 insertions(+) diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h index 9fa0cab..7a68d28a 100644 --- a/drivers/hv/hyperv_vmbus.h +++ b/drivers/hv/hyperv_vmbus.h @@ -49,6 +49,17 @@ enum hv_cpuid_function { HVCPUID_IMPLEMENTATION_LIMITS = 0x4005, }; +#define HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE 0x400 + +#define HV_X64_MSR_CRASH_P0 0x4100 +#define HV_X64_MSR_CRASH_P1 0x4101 +#define HV_X64_MSR_CRASH_P2 0x4102 +#define HV_X64_MSR_CRASH_P3 0x4103 +#define HV_X64_MSR_CRASH_P4 0x4104 +#define HV_X64_MSR_CRASH_CTL 0x4105 + +#define HV_CRASH_CTL_CRASH_NOTIFY 0x8000 + /* Define version of the synthetic interrupt controller. */ #define HV_SYNIC_VERSION (1) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 48aad4f..4b3d72a 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -37,6 +37,8 @@ #include #include #include +#include +#include #include "hyperv_vmbus.h" @@ -46,6 +48,36 @@ static struct tasklet_struct msg_dpc; static struct completion probe_event; static int irq; +int hyperv_panic_event(struct notifier_block *nb, + unsigned long event, void *ptr) +{ + struct pt_regs *regs; + + regs = current_pt_regs(); + + wrmsrl(HV_X64_MSR_CRASH_P0, regs->ip); + wrmsrl(HV_X64_MSR_CRASH_P1, regs->ax); + wrmsrl(HV_X64_MSR_CRASH_P2, regs->bx); + wrmsrl(HV_X64_MSR_CRASH_P3, regs->cx); + wrmsrl(HV_X64_MSR_CRASH_P4, regs->dx); + + /* +* Let Hyper-V know there is crash data available +*/ + wrmsrl(HV_X64_MSR_CRASH_CTL, HV_CRASH_CTL_CRASH_NOTIFY); + return NOTIFY_DONE; +} + +static struct notifier_block hyperv_panic_block = { + .notifier_call = hyperv_panic_event, +}; + +struct resource hyperv_mmio = { + .name = "hyperv mmio", + .flags = IORESOURCE_MEM, +}; +EXPORT_SYMBOL_GPL(hyperv_mmio); + static int vmbus_exists(void) { if (hv_acpi_dev == NULL) @@ -749,6 +781,14 @@ static int vmbus_bus_init(int irq) if (ret) goto err_alloc; + /* +* Only register if the crash MSRs are available +*/ + if (ms_hyperv.features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) { + atomic_notifier_chain_register(&panic_notifier_list, + &hyperv_panic_block); + } + vmbus_request_offers(); return 0; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[V2][3.13.y-ckt][PATCH 0/1][Hyper-V] Add support for VMBus panic notifier handler
Hello, Please consider including upstream commits 96c1d0581d00f7abe033350edb021a9d947d8d81 and 5ef5b6927f14f29cacd78fa1fb861661a5367f13 in the next v3.13.y-ckt release. They were included mainline as of v4.1-rc1. They have been tested and confirmed to resolve http://bugs.launchpad.net/bugs/1463584 . commit 96c1d0581d00f7abe033350edb021a9d947d8d81 Author: Nick Meier Date: Sat Feb 28 11:39:01 2015 -0800 Drivers: hv: vmbus: Add support for VMBus panic notifier handler commit 5ef5b6927f14f29cacd78fa1fb861661a5367f13 Author: Nick Meier Date: Wed Mar 18 12:29:24 2015 -0700 Drivers: hv: vmbus: Correcting truncation error for constant HV_CRASH_CTL_CRASH_NOTIFY Commit 96c1d05 does not apply cleanly to v3.13.y-ckt, so I performed a backport, which is in email 1/1. Sincerely, Joseph Salisbury Nick Meier (1): Drivers: hv: vmbus: Add support for VMBus panic notifier handler drivers/hv/hyperv_vmbus.h | 11 +++ drivers/hv/vmbus_drv.c| 40 2 files changed, 51 insertions(+) -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[V2][v3.14.y][PATCH 0/1] Drivers: hv: vmbus: Add support for VMBus panic notifier handler
Hello, Please consider including upstream commits 96c1d0581d00f7abe033350edb021a9d947d8d81 and 5ef5b6927f14f29cacd78fa1fb861661a5367f13 in the next v3.14.y release. They were included mainline as of v4.1-rc1. They have been tested and confirmed to resolve http://bugs.launchpad.net/bugs/1463584 . commit 96c1d0581d00f7abe033350edb021a9d947d8d81 Author: Nick Meier Date: Sat Feb 28 11:39:01 2015 -0800 Drivers: hv: vmbus: Add support for VMBus panic notifier handler commit 5ef5b6927f14f29cacd78fa1fb861661a5367f13 Author: Nick Meier Date: Wed Mar 18 12:29:24 2015 -0700 Drivers: hv: vmbus: Correcting truncation error for constant HV_CRASH_CTL_CRASH_NOTIFY Commit 96c1d05 does not apply cleanly to v3.14.y, so I performed a backport, which is in email 1/1. Sincerely, Joseph Salisbury Nick Meier (1): Drivers: hv: vmbus: Add support for VMBus panic notifier handler drivers/hv/hyperv_vmbus.h | 11 +++ drivers/hv/vmbus_drv.c| 40 2 files changed, 51 insertions(+) -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[V2][v3.14.y][PATCH 0/1] Drivers: hv: vmbus: Add support for VMBus panic notifier handler
From: Nick Meier Hyper-V allows a guest to notify the Hyper-V host that a panic condition occured. This notification can include up to five 64 bit values. These 64 bit values are written into crash MSRs. Once the data has been written into the crash MSRs, the host is then notified by writing into a Crash Control MSR. On the Hyper-V host, the panic notification data is captured in the Windows Event log as a 18590 event. Crash MSRs are defined in appendix H of the Hypervisor Top Level Functional Specification. At the time of this patch, v4.0 is the current functional spec. The URL for the v4.0 document is: http://download.microsoft.com/download/A/B/4/AB43A34E-BDD0-4FA6-BDEF-79EEF16E880B/Hypervisor Top Level Functional Specification v4.0.docx Signed-off-by: Nick Meier Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman (backported from commit 96c1d0581d00f7abe033350edb021a9d947d8d81) Signed-off-by: Joseph Salisbury --- drivers/hv/hyperv_vmbus.h | 11 +++ drivers/hv/vmbus_drv.c| 40 2 files changed, 51 insertions(+) diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h index e055176..3f39c73 100644 --- a/drivers/hv/hyperv_vmbus.h +++ b/drivers/hv/hyperv_vmbus.h @@ -49,6 +49,17 @@ enum hv_cpuid_function { HVCPUID_IMPLEMENTATION_LIMITS = 0x4005, }; +#define HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE 0x400 + +#define HV_X64_MSR_CRASH_P0 0x4100 +#define HV_X64_MSR_CRASH_P1 0x4101 +#define HV_X64_MSR_CRASH_P2 0x4102 +#define HV_X64_MSR_CRASH_P3 0x4103 +#define HV_X64_MSR_CRASH_P4 0x4104 +#define HV_X64_MSR_CRASH_CTL 0x4105 + +#define HV_CRASH_CTL_CRASH_NOTIFY 0x8000 + /* Define version of the synthetic interrupt controller. */ #define HV_SYNIC_VERSION (1) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 077bb1b..66168c3 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -36,6 +36,8 @@ #include #include #include +#include +#include #include "hyperv_vmbus.h" static struct acpi_device *hv_acpi_dev; @@ -44,6 +46,36 @@ static struct tasklet_struct msg_dpc; static struct completion probe_event; static int irq; +int hyperv_panic_event(struct notifier_block *nb, + unsigned long event, void *ptr) +{ + struct pt_regs *regs; + + regs = current_pt_regs(); + + wrmsrl(HV_X64_MSR_CRASH_P0, regs->ip); + wrmsrl(HV_X64_MSR_CRASH_P1, regs->ax); + wrmsrl(HV_X64_MSR_CRASH_P2, regs->bx); + wrmsrl(HV_X64_MSR_CRASH_P3, regs->cx); + wrmsrl(HV_X64_MSR_CRASH_P4, regs->dx); + + /* +* Let Hyper-V know there is crash data available +*/ + wrmsrl(HV_X64_MSR_CRASH_CTL, HV_CRASH_CTL_CRASH_NOTIFY); + return NOTIFY_DONE; +} + +static struct notifier_block hyperv_panic_block = { + .notifier_call = hyperv_panic_event, +}; + +struct resource hyperv_mmio = { + .name = "hyperv mmio", + .flags = IORESOURCE_MEM, +}; +EXPORT_SYMBOL_GPL(hyperv_mmio); + static int vmbus_exists(void) { if (hv_acpi_dev == NULL) @@ -747,6 +779,14 @@ static int vmbus_bus_init(int irq) if (ret) goto err_alloc; + /* +* Only register if the crash MSRs are available +*/ + if (ms_hyperv.features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) { + atomic_notifier_chain_register(&panic_notifier_list, + &hyperv_panic_block); + } + vmbus_request_offers(); return 0; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [v3.16.y-ckt][v3.18.y][v3.19.y-ckt][v4.0.y][PATCH 0/1][Hyper-V] Add support for VMBus panic notifier handler
On Tue, 2015-06-16 at 16:22 -0400, Joseph Salisbury wrote: > Hello, > > Please consider including upstream commits > 96c1d0581d00f7abe033350edb021a9d947d8d81 and > 5ef5b6927f14f29cacd78fa1fb861661a5367f13 in the next v3.16.y-ckt, v3.18.y, > v3.19.y-ckt and v4.0.y releases. > They were included mainline as of v4.1-rc1. They have been tested and > confirmed to resolve > http://bugs.launchpad.net/bugs/1463584 . > > > commit 96c1d0581d00f7abe033350edb021a9d947d8d81 > Author: Nick Meier > Date: Sat Feb 28 11:39:01 2015 -0800 > > Drivers: hv: vmbus: Add support for VMBus panic notifier handler > > commit 5ef5b6927f14f29cacd78fa1fb861661a5367f13 > Author: Nick Meier > Date: Wed Mar 18 12:29:24 2015 -0700 > > Drivers: hv: vmbus: Correcting truncation error for constant > HV_CRASH_CTL_CRASH_NOTIFY > > > Commit 96c1d05 does not cherry-pick cleanly, so I performed a backport, which > is > in email 1/1. Thanks Joseph! Queued up for 3.19-stable. -Kamal ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [V2][3.13.y-ckt][PATCH 0/1][Hyper-V] Add support for VMBus panic notifier handler
On Wed, 2015-06-17 at 14:09 -0400, Joseph Salisbury wrote: > Hello, > > Please consider including upstream commits > 96c1d0581d00f7abe033350edb021a9d947d8d81 and > 5ef5b6927f14f29cacd78fa1fb861661a5367f13 in the next v3.13.y-ckt release. > They were > included mainline as of v4.1-rc1. They have been tested and confirmed to > resolve > http://bugs.launchpad.net/bugs/1463584 . > > > commit 96c1d0581d00f7abe033350edb021a9d947d8d81 > Author: Nick Meier > Date: Sat Feb 28 11:39:01 2015 -0800 > > Drivers: hv: vmbus: Add support for VMBus panic notifier handler > > commit 5ef5b6927f14f29cacd78fa1fb861661a5367f13 > Author: Nick Meier > Date: Wed Mar 18 12:29:24 2015 -0700 > > Drivers: hv: vmbus: Correcting truncation error for constant > HV_CRASH_CTL_CRASH_NOTIFY > > > Commit 96c1d05 does not apply cleanly to v3.13.y-ckt, so I performed a > backport, which is > in email 1/1. Thanks Joseph! Queued up for 3.13-stable: your [V2] backport of 96c1d05, and the cherry-pick of 5ef5b69. -Kamal ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 1/6] hv: Modify vmbus to search for all MMIO ranges available
On Wed, Jun 17, 2015 at 05:41:58PM +, Jake Oshins wrote: > > -Original Message- > > From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] > > Sent: Wednesday, June 17, 2015 10:28 AM > > To: Jake Oshins > > Cc: gre...@linuxfoundation.org; KY Srinivasan; linux- > > ker...@vger.kernel.org; de...@linuxdriverproject.org; o...@aepfle.de; > > a...@canonical.com; Haiyang Zhang; Mike Ebersol > > Subject: Re: [PATCH v3 1/6] hv: Modify vmbus to search for all MMIO ranges > > available > > > } > > > > > > @@ -1047,6 +1121,7 @@ static struct acpi_driver vmbus_acpi_driver = { > > > .ids = vmbus_acpi_device_ids, > > > .ops = { > > > .add = vmbus_acpi_add, > > > + .remove = vmbus_acpi_remove, > > > > This will probably need rebasing on top of current char-misc-next tree > > as we already have commit e4ecb41c: "Drivers: hv: vmbus: introduce > > vmbus_acpi_remove" there. > > > > Thanks. Please educate me since I'm new around here. What should I > do in response to this message? Wait for this tree to be pulled into > the mainline and resend after rebasing? Something more proactive? It's KY's job to do this type of thing, he should handle this for you :) greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: solo6x10: all interrupts for all cards handled by CPU0, no balancing - why?
On Fri, 30 Jan 2015 00:29:13 +0200 Andrey Utkin wrote: > The host was rebooted and got back online. > Without irqbalance daemon, all solo6x10 interrupts are still on CPU0. > See https://gist.github.com/krieger-od/d1686243c67fbe3e14a5 > Any ideas are strongly appreciated. > My understanding was that balancing happened by package, not by core, but my knowledge might be outdated... ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/22] staging: comedi: amplc_pci230: rename 'thisboard' variables
For aesthetics, rename the 'thisboard' variables to 'board'. That name is more commonly used for the boardinfo pointer in comedi drivers. Signed-off-by: H Hartley Sweeten --- drivers/staging/comedi/drivers/amplc_pci230.c | 44 +-- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/drivers/staging/comedi/drivers/amplc_pci230.c b/drivers/staging/comedi/drivers/amplc_pci230.c index 20d5920..3b0c518 100644 --- a/drivers/staging/comedi/drivers/amplc_pci230.c +++ b/drivers/staging/comedi/drivers/amplc_pci230.c @@ -528,7 +528,7 @@ static const struct comedi_lrange pci230_ao_range = { static unsigned short pci230_ai_read(struct comedi_device *dev) { - const struct pci230_board *thisboard = dev->board_ptr; + const struct pci230_board *board = dev->board_ptr; struct pci230_private *devpriv = dev->private; unsigned short data; @@ -543,21 +543,21 @@ static unsigned short pci230_ai_read(struct comedi_device *dev) */ if (devpriv->ai_bipolar) data ^= 0x8000; - data >>= (16 - thisboard->ai_bits); + data >>= (16 - board->ai_bits); return data; } static unsigned short pci230_ao_mangle_datum(struct comedi_device *dev, unsigned short datum) { - const struct pci230_board *thisboard = dev->board_ptr; + const struct pci230_board *board = dev->board_ptr; struct pci230_private *devpriv = dev->private; /* * PCI230 is 12 bit - stored in upper bits of 16 bit register (lower * four bits reserved for expansion). PCI230+ is also 12 bit AO. */ - datum <<= (16 - thisboard->ao_bits); + datum <<= (16 - board->ao_bits); /* * If a bipolar range was specified, mangle it * (straight binary->twos complement). @@ -877,7 +877,7 @@ static int pci230_ao_check_chanlist(struct comedi_device *dev, static int pci230_ao_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_cmd *cmd) { - const struct pci230_board *thisboard = dev->board_ptr; + const struct pci230_board *board = dev->board_ptr; struct pci230_private *devpriv = dev->private; int err = 0; unsigned int tmp; @@ -887,14 +887,14 @@ static int pci230_ao_cmdtest(struct comedi_device *dev, err |= comedi_check_trigger_src(&cmd->start_src, TRIG_INT); tmp = TRIG_TIMER | TRIG_INT; - if (thisboard->min_hwver > 0 && devpriv->hwver >= 2) { + if (board->min_hwver > 0 && devpriv->hwver >= 2) { /* * For PCI230+ hardware version 2 onwards, allow external * trigger from EXTTRIG/EXTCONVCLK input (PCI230+ pin 25). * * FIXME: The permitted scan_begin_src values shouldn't depend * on devpriv->hwver (the detected card's actual hardware -* version). They should only depend on thisboard->min_hwver +* version). They should only depend on board->min_hwver * (the static capabilities of the configured card). To fix * it, a new card model, e.g. "pci230+2" would have to be * defined with min_hwver set to 2. It doesn't seem worth it @@ -1500,7 +1500,7 @@ static int pci230_ai_check_chanlist(struct comedi_device *dev, static int pci230_ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_cmd *cmd) { - const struct pci230_board *thisboard = dev->board_ptr; + const struct pci230_board *board = dev->board_ptr; struct pci230_private *devpriv = dev->private; int err = 0; unsigned int tmp; @@ -1510,7 +1510,7 @@ static int pci230_ai_cmdtest(struct comedi_device *dev, err |= comedi_check_trigger_src(&cmd->start_src, TRIG_NOW | TRIG_INT); tmp = TRIG_FOLLOW | TRIG_TIMER | TRIG_INT; - if (thisboard->have_dio || thisboard->min_hwver > 0) { + if (board->have_dio || board->min_hwver > 0) { /* * Unfortunately, we cannot trigger a scan off an external * source on the PCI260 board, since it uses the PPIC0 (DIO) @@ -2364,7 +2364,7 @@ static int pci230_auto_attach(struct comedi_device *dev, unsigned long context_unused) { struct pci_dev *pci_dev = comedi_to_pci_dev(dev); - const struct pci230_board *thisboard; + const struct pci230_board *board; struct pci230_private *devpriv; struct comedi_subdevice *s; int rc; @@ -2381,14 +2381,14 @@ static int pci230_auto_attach(struct comedi_device *dev, spin_lock_init(&devpriv->ai_stop_spinlock); spin_lock_init(&devpriv->ao_stop_spinlock); - dev->board_ptr = pci230_find_pci_board(pci_dev); - if (!dev->board_ptr) { + board = pci230_find_pci_board(pci_dev
[PATCH 02/22] staging: comedi: amplc_pci224: rename 'thisboard' variables
For aesthetics, rename the 'thisboard' variables to 'board'. That name is more commonly used for the boardinfo pointer in comedi drivers. Signed-off-by: H Hartley Sweeten --- drivers/staging/comedi/drivers/amplc_pci224.c | 42 +-- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c b/drivers/staging/comedi/drivers/amplc_pci224.c index 08a9185..b2f7679 100644 --- a/drivers/staging/comedi/drivers/amplc_pci224.c +++ b/drivers/staging/comedi/drivers/amplc_pci224.c @@ -385,14 +385,14 @@ static void pci224_ao_set_data(struct comedi_device *dev, int chan, int range, unsigned int data) { - const struct pci224_board *thisboard = dev->board_ptr; + const struct pci224_board *board = dev->board_ptr; struct pci224_private *devpriv = dev->private; unsigned short mangled; /* Enable the channel. */ outw(1 << chan, dev->iobase + PCI224_DACCEN); /* Set range and reset FIFO. */ - devpriv->daccon = COMBINE(devpriv->daccon, thisboard->ao_hwrange[range], + devpriv->daccon = COMBINE(devpriv->daccon, board->ao_hwrange[range], PCI224_DACCON_POLAR_MASK | PCI224_DACCON_VREF_MASK); outw(devpriv->daccon | PCI224_DACCON_FIFORESET, @@ -402,7 +402,7 @@ pci224_ao_set_data(struct comedi_device *dev, int chan, int range, * - bipolar: 16-bit 2's complement * - unipolar: 16-bit unsigned */ - mangled = (unsigned short)data << (16 - thisboard->ao_bits); + mangled = (unsigned short)data << (16 - board->ao_bits); if ((devpriv->daccon & PCI224_DACCON_POLAR_MASK) == PCI224_DACCON_POLAR_BI) { mangled ^= 0x8000; @@ -620,12 +620,12 @@ static int pci224_ao_check_chanlist(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_cmd *cmd) { - const struct pci224_board *thisboard = dev->board_ptr; + const struct pci224_board *board = dev->board_ptr; unsigned int range_check_0; unsigned int chan_mask = 0; int i; - range_check_0 = thisboard->ao_range_check[CR_RANGE(cmd->chanlist[0])]; + range_check_0 = board->ao_range_check[CR_RANGE(cmd->chanlist[0])]; for (i = 0; i < cmd->chanlist_len; i++) { unsigned int chan = CR_CHAN(cmd->chanlist[i]); @@ -637,7 +637,7 @@ static int pci224_ao_check_chanlist(struct comedi_device *dev, } chan_mask |= 1 << chan; - if (thisboard->ao_range_check[CR_RANGE(cmd->chanlist[i])] != + if (board->ao_range_check[CR_RANGE(cmd->chanlist[i])] != range_check_0) { dev_dbg(dev->class_dev, "%s: entries in chanlist have incompatible ranges\n", @@ -826,7 +826,7 @@ static void pci224_ao_start_pacer(struct comedi_device *dev, static int pci224_ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s) { - const struct pci224_board *thisboard = dev->board_ptr; + const struct pci224_board *board = dev->board_ptr; struct pci224_private *devpriv = dev->private; struct comedi_cmd *cmd = &s->async->cmd; int range; @@ -869,7 +869,7 @@ static int pci224_ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s) */ devpriv->daccon = COMBINE(devpriv->daccon, - thisboard->ao_hwrange[range] | PCI224_DACCON_TRIG_NONE | + board->ao_hwrange[range] | PCI224_DACCON_TRIG_NONE | PCI224_DACCON_FIFOINTR_NHALF, PCI224_DACCON_POLAR_MASK | PCI224_DACCON_VREF_MASK | PCI224_DACCON_TRIG_MASK | PCI224_DACCON_FIFOINTR_MASK); @@ -911,7 +911,7 @@ static void pci224_ao_munge(struct comedi_device *dev, struct comedi_subdevice *s, void *data, unsigned int num_bytes, unsigned int chan_index) { - const struct pci224_board *thisboard = dev->board_ptr; + const struct pci224_board *board = dev->board_ptr; struct comedi_cmd *cmd = &s->async->cmd; unsigned short *array = data; unsigned int length = num_bytes / sizeof(*array); @@ -920,9 +920,9 @@ pci224_ao_munge(struct comedi_device *dev, struct comedi_subdevice *s, unsigned int i; /* The hardware expects 16-bit numbers. */ - shift = 16 - thisboard->ao_bits; + shift = 16 - board->ao_bits; /* Channels will be all bipolar or all unipolar. */ - if ((thisboard->ao_hwrange[CR_RANGE(cmd->chanlist[0])] & + if ((board->ao_hwrange[CR_RANGE(cmd->chanlist[0])] & PCI224_DACCON_POLAR_MASK) == PCI224_DACCON_POLAR_UNI) { /* Unipolar */ offset = 0; @@ -988,21 +988,21 @@ static int pci224_auto_attach(struct comedi_device
[PATCH 21/22] staging: comedi: addi_apci_1516: rename 'this_board' variables
For aesthetics, rename the 'this_board' variables to 'board'. That name is more commonly used for the boardinfo pointer in comedi drivers. Signed-off-by: H Hartley Sweeten --- drivers/staging/comedi/drivers/addi_apci_1516.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_1516.c b/drivers/staging/comedi/drivers/addi_apci_1516.c index 9c516d1..f1f8b1c 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1516.c +++ b/drivers/staging/comedi/drivers/addi_apci_1516.c @@ -100,10 +100,10 @@ static int apci1516_do_insn_bits(struct comedi_device *dev, static int apci1516_reset(struct comedi_device *dev) { - const struct apci1516_boardinfo *this_board = dev->board_ptr; + const struct apci1516_boardinfo *board = dev->board_ptr; struct apci1516_private *devpriv = dev->private; - if (!this_board->has_wdog) + if (!board->has_wdog) return 0; outw(0x0, dev->iobase + APCI1516_DO_REG); @@ -117,17 +117,17 @@ static int apci1516_auto_attach(struct comedi_device *dev, unsigned long context) { struct pci_dev *pcidev = comedi_to_pci_dev(dev); - const struct apci1516_boardinfo *this_board = NULL; + const struct apci1516_boardinfo *board = NULL; struct apci1516_private *devpriv; struct comedi_subdevice *s; int ret; if (context < ARRAY_SIZE(apci1516_boardtypes)) - this_board = &apci1516_boardtypes[context]; - if (!this_board) + board = &apci1516_boardtypes[context]; + if (!board) return -ENODEV; - dev->board_ptr = this_board; - dev->board_name = this_board->name; + dev->board_ptr = board; + dev->board_name = board->name; devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv)); if (!devpriv) @@ -146,10 +146,10 @@ static int apci1516_auto_attach(struct comedi_device *dev, /* Initialize the digital input subdevice */ s = &dev->subdevices[0]; - if (this_board->di_nchan) { + if (board->di_nchan) { s->type = COMEDI_SUBD_DI; s->subdev_flags = SDF_READABLE; - s->n_chan = this_board->di_nchan; + s->n_chan = board->di_nchan; s->maxdata = 1; s->range_table = &range_digital; s->insn_bits= apci1516_di_insn_bits; @@ -159,10 +159,10 @@ static int apci1516_auto_attach(struct comedi_device *dev, /* Initialize the digital output subdevice */ s = &dev->subdevices[1]; - if (this_board->do_nchan) { + if (board->do_nchan) { s->type = COMEDI_SUBD_DO; s->subdev_flags = SDF_WRITABLE; - s->n_chan = this_board->do_nchan; + s->n_chan = board->do_nchan; s->maxdata = 1; s->range_table = &range_digital; s->insn_bits= apci1516_do_insn_bits; @@ -172,7 +172,7 @@ static int apci1516_auto_attach(struct comedi_device *dev, /* Initialize the watchdog subdevice */ s = &dev->subdevices[2]; - if (this_board->has_wdog) { + if (board->has_wdog) { ret = addi_watchdog_init(s, devpriv->wdog_iobase); if (ret) return ret; -- 2.4.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/22] staging: comedi: cb_pcidda: rename 'thisboard' variables
For aesthetics, rename the 'thisboard' variables to 'board'. That name is more commonly used for the boardinfo pointer in comedi drivers. Signed-off-by: H Hartley Sweeten --- drivers/staging/comedi/drivers/cb_pcidda.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/comedi/drivers/cb_pcidda.c b/drivers/staging/comedi/drivers/cb_pcidda.c index 30c9e27..b00a36a 100644 --- a/drivers/staging/comedi/drivers/cb_pcidda.c +++ b/drivers/staging/comedi/drivers/cb_pcidda.c @@ -335,18 +335,18 @@ static int cb_pcidda_auto_attach(struct comedi_device *dev, unsigned long context) { struct pci_dev *pcidev = comedi_to_pci_dev(dev); - const struct cb_pcidda_board *thisboard = NULL; + const struct cb_pcidda_board *board = NULL; struct cb_pcidda_private *devpriv; struct comedi_subdevice *s; int i; int ret; if (context < ARRAY_SIZE(cb_pcidda_boards)) - thisboard = &cb_pcidda_boards[context]; - if (!thisboard) + board = &cb_pcidda_boards[context]; + if (!board) return -ENODEV; - dev->board_ptr = thisboard; - dev->board_name = thisboard->name; + dev->board_ptr = board; + dev->board_name = board->name; devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv)); if (!devpriv) @@ -366,8 +366,8 @@ static int cb_pcidda_auto_attach(struct comedi_device *dev, /* analog output subdevice */ s->type = COMEDI_SUBD_AO; s->subdev_flags = SDF_WRITABLE; - s->n_chan = thisboard->ao_chans; - s->maxdata = (1 << thisboard->ao_bits) - 1; + s->n_chan = board->ao_chans; + s->maxdata = (1 << board->ao_bits) - 1; s->range_table = &cb_pcidda_ranges; s->insn_write = cb_pcidda_ao_insn_write; @@ -384,7 +384,7 @@ static int cb_pcidda_auto_attach(struct comedi_device *dev, devpriv->eeprom_data[i] = cb_pcidda_read_eeprom(dev, i); /* set calibrations dacs */ - for (i = 0; i < thisboard->ao_chans; i++) + for (i = 0; i < board->ao_chans; i++) cb_pcidda_calibrate(dev, i, devpriv->ao_range[i]); return 0; -- 2.4.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/22] staging: comedi: amplc_pc236_common: rename 'thisboard' variables
For aesthetics, rename the 'thisboard' variables to 'board'. That name is more commonly used for the boardinfo pointer in comedi drivers. Signed-off-by: H Hartley Sweeten --- drivers/staging/comedi/drivers/amplc_pc236_common.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/comedi/drivers/amplc_pc236_common.c b/drivers/staging/comedi/drivers/amplc_pc236_common.c index 245f932..0c02d32 100644 --- a/drivers/staging/comedi/drivers/amplc_pc236_common.c +++ b/drivers/staging/comedi/drivers/amplc_pc236_common.c @@ -28,14 +28,14 @@ static void pc236_intr_update(struct comedi_device *dev, bool enable) { - const struct pc236_board *thisboard = dev->board_ptr; + const struct pc236_board *board = dev->board_ptr; struct pc236_private *devpriv = dev->private; unsigned long flags; spin_lock_irqsave(&dev->spinlock, flags); devpriv->enable_irq = enable; - if (thisboard->intr_update_cb) - thisboard->intr_update_cb(dev, enable); + if (board->intr_update_cb) + board->intr_update_cb(dev, enable); spin_unlock_irqrestore(&dev->spinlock, flags); } @@ -48,15 +48,15 @@ static void pc236_intr_update(struct comedi_device *dev, bool enable) */ static bool pc236_intr_check(struct comedi_device *dev) { - const struct pc236_board *thisboard = dev->board_ptr; + const struct pc236_board *board = dev->board_ptr; struct pc236_private *devpriv = dev->private; bool retval = false; unsigned long flags; spin_lock_irqsave(&dev->spinlock, flags); if (devpriv->enable_irq) { - if (thisboard->intr_chk_clr_cb) - retval = thisboard->intr_chk_clr_cb(dev); + if (board->intr_chk_clr_cb) + retval = board->intr_chk_clr_cb(dev); else retval = true; } -- 2.4.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 00/22] staging: comedi: cleanup boardinfo usage in drivers
Many of the comedi drivers support multiple boards with different features. The differences are usually handled by some type of const array that describes the board. A pointer this data is stored in the comedi_device as the 'dev->board_ptr'. Most of the drivers use a local variable called 'board' to reference the dev->board_ptr when needed. There are a couple drivers that use some other name for the local variable. To make all the comedi drivers consistent, rename all the variables used to reference the dev->board_ptr to 'board'. Also, tidy up a couple odd 'probe' functions used to find the correct boardinfo. H Hartley Sweeten (22): staging: comedi: amplc_pc236_common: rename 'thisboard' variables staging: comedi: amplc_pci224: rename 'thisboard' variables staging: comedi: amplc_pci230: rename 'thisboard' variables staging: comedi: cb_pcidda: rename 'thisboard' variables staging: comedi: ni_670x: rename 'thisboard' variables staging: comedi: ni_at_a2150: cleanup a2150_probe() staging: comedi: ni_at_a2150: rename 'thisboard' variables staging: comedi: das08_isa: rename 'thisboard' variables staging: comedi: das08: rename 'thisboard' variables staging: comedi: das800: cleanup das800_probe() staging: comedi: das800: rename 'thisboard' variables staging: comedi: das1800: cleanup das1800_probe() staging: comedi: das1800: rename 'thisboard' variables staging: comedi: me4000: rename 'thisboard' variables staging: comedi: cb_pcidas: rename 'thisboard' variables staging: comedi: cb_pcidas64: rename 'thisboard' variables staging: comedi: adv_pci_dio: rename 'this_board' variables staging: comedi: dt3000: rename 'this_board' variables staging: comedi: vmk80xx: rename 'boardinfo' variables staging: comedi: ni_atmio: cleanup ni_getboardtype() staging: comedi: addi_apci_1516: rename 'this_board' variables staging: comedi: addi_apci_3120: rename 'this_board' variables drivers/staging/comedi/drivers/addi_apci_1516.c| 24 +-- drivers/staging/comedi/drivers/addi_apci_3120.c| 14 +- drivers/staging/comedi/drivers/adv_pci_dio.c | 48 ++--- .../staging/comedi/drivers/amplc_pc236_common.c| 12 +- drivers/staging/comedi/drivers/amplc_pci224.c | 42 ++-- drivers/staging/comedi/drivers/amplc_pci230.c | 44 ++--- drivers/staging/comedi/drivers/cb_pcidas.c | 64 +++--- drivers/staging/comedi/drivers/cb_pcidas64.c | 218 ++--- drivers/staging/comedi/drivers/cb_pcidda.c | 16 +- drivers/staging/comedi/drivers/das08.c | 51 +++-- drivers/staging/comedi/drivers/das08_isa.c | 4 +- drivers/staging/comedi/drivers/das1800.c | 86 drivers/staging/comedi/drivers/das800.c| 75 +++ drivers/staging/comedi/drivers/dt3000.c| 22 +-- drivers/staging/comedi/drivers/me4000.c| 30 +-- drivers/staging/comedi/drivers/ni_670x.c | 12 +- drivers/staging/comedi/drivers/ni_at_a2150.c | 38 ++-- drivers/staging/comedi/drivers/ni_atmio.c | 26 ++- drivers/staging/comedi/drivers/vmk80xx.c | 33 ++-- 19 files changed, 431 insertions(+), 428 deletions(-) -- 2.4.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/22] staging: comedi: ni_670x: rename 'thisboard' variables
For aesthetics, rename the 'thisboard' variables to 'board'. That name is more commonly used for the boardinfo pointer in comedi drivers. Signed-off-by: H Hartley Sweeten --- drivers/staging/comedi/drivers/ni_670x.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_670x.c b/drivers/staging/comedi/drivers/ni_670x.c index 13c6ccb..f4c580f 100644 --- a/drivers/staging/comedi/drivers/ni_670x.c +++ b/drivers/staging/comedi/drivers/ni_670x.c @@ -172,18 +172,18 @@ static int ni_670x_auto_attach(struct comedi_device *dev, unsigned long context) { struct pci_dev *pcidev = comedi_to_pci_dev(dev); - const struct ni_670x_board *thisboard = NULL; + const struct ni_670x_board *board = NULL; struct ni_670x_private *devpriv; struct comedi_subdevice *s; int ret; int i; if (context < ARRAY_SIZE(ni_670x_boards)) - thisboard = &ni_670x_boards[context]; - if (!thisboard) + board = &ni_670x_boards[context]; + if (!board) return -ENODEV; - dev->board_ptr = thisboard; - dev->board_name = thisboard->name; + dev->board_ptr = board; + dev->board_name = board->name; ret = comedi_pci_enable(dev); if (ret) @@ -209,7 +209,7 @@ static int ni_670x_auto_attach(struct comedi_device *dev, /* analog output subdevice */ s->type = COMEDI_SUBD_AO; s->subdev_flags = SDF_WRITABLE; - s->n_chan = thisboard->ao_chans; + s->n_chan = board->ao_chans; s->maxdata = 0x; if (s->n_chan == 32) { const struct comedi_lrange **range_table_list; -- 2.4.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/22] staging: comedi: ni_at_a2150: cleanup a2150_probe()
Make this function return a pointer to the boardinfo instead of an index. Signed-off-by: H Hartley Sweeten --- drivers/staging/comedi/drivers/ni_at_a2150.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_at_a2150.c b/drivers/staging/comedi/drivers/ni_at_a2150.c index 60469bb..1cd4869 100644 --- a/drivers/staging/comedi/drivers/ni_at_a2150.c +++ b/drivers/staging/comedi/drivers/ni_at_a2150.c @@ -687,12 +687,14 @@ static void a2150_free_dma(struct comedi_device *dev) comedi_isadma_free(devpriv->dma); } -/* probes board type, returns offset */ -static int a2150_probe(struct comedi_device *dev) +static const struct a2150_board *a2150_probe(struct comedi_device *dev) { - int status = inw(dev->iobase + STATUS_REG); + int id = ID_BITS(inw(dev->iobase + STATUS_REG)); - return ID_BITS(status); + if (id >= ARRAY_SIZE(a2150_boards)) + return NULL; + + return &a2150_boards[id]; } static int a2150_attach(struct comedi_device *dev, struct comedi_devconfig *it) @@ -712,12 +714,10 @@ static int a2150_attach(struct comedi_device *dev, struct comedi_devconfig *it) if (ret) return ret; - i = a2150_probe(dev); - if (i >= ARRAY_SIZE(a2150_boards)) + thisboard = a2150_probe(dev); + if (!thisboard) return -ENODEV; - - dev->board_ptr = a2150_boards + i; - thisboard = dev->board_ptr; + dev->board_ptr = thisboard; dev->board_name = thisboard->name; /* an IRQ and DMA are required to support async commands */ -- 2.4.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 22/22] staging: comedi: addi_apci_3120: rename 'this_board' variables
For aesthetics, rename the 'this_board' variables to 'board'. That name is more commonly used for the boardinfo pointer in comedi drivers. Signed-off-by: H Hartley Sweeten --- drivers/staging/comedi/drivers/addi_apci_3120.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_3120.c b/drivers/staging/comedi/drivers/addi_apci_3120.c index 95dc64b..5bfd43d 100644 --- a/drivers/staging/comedi/drivers/addi_apci_3120.c +++ b/drivers/staging/comedi/drivers/addi_apci_3120.c @@ -977,18 +977,18 @@ static int apci3120_auto_attach(struct comedi_device *dev, unsigned long context) { struct pci_dev *pcidev = comedi_to_pci_dev(dev); - const struct apci3120_board *this_board = NULL; + const struct apci3120_board *board = NULL; struct apci3120_private *devpriv; struct comedi_subdevice *s; unsigned int status; int ret; if (context < ARRAY_SIZE(apci3120_boardtypes)) - this_board = &apci3120_boardtypes[context]; - if (!this_board) + board = &apci3120_boardtypes[context]; + if (!board) return -ENODEV; - dev->board_ptr = this_board; - dev->board_name = this_board->name; + dev->board_ptr = board; + dev->board_name = board->name; devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv)); if (!devpriv) @@ -1031,7 +1031,7 @@ static int apci3120_auto_attach(struct comedi_device *dev, s->type = COMEDI_SUBD_AI; s->subdev_flags = SDF_READABLE | SDF_COMMON | SDF_GROUND | SDF_DIFF; s->n_chan = 16; - s->maxdata = this_board->ai_is_16bit ? 0x : 0x0fff; + s->maxdata = board->ai_is_16bit ? 0x : 0x0fff; s->range_table = &apci3120_ai_range; s->insn_read= apci3120_ai_insn_read; if (dev->irq) { @@ -1045,7 +1045,7 @@ static int apci3120_auto_attach(struct comedi_device *dev, /* Analog Output subdevice */ s = &dev->subdevices[1]; - if (this_board->has_ao) { + if (board->has_ao) { s->type = COMEDI_SUBD_AO; s->subdev_flags = SDF_WRITABLE | SDF_GROUND | SDF_COMMON; s->n_chan = 8; -- 2.4.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/22] staging: comedi: das08: rename 'thisboard' variables
For aesthetics, rename the 'thisboard' variables to 'board'. That name is more commonly used for the boardinfo pointer in comedi drivers. Signed-off-by: H Hartley Sweeten --- drivers/staging/comedi/drivers/das08.c | 51 +- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c index 700a40b..3d8fc6a 100644 --- a/drivers/staging/comedi/drivers/das08.c +++ b/drivers/staging/comedi/drivers/das08.c @@ -178,7 +178,7 @@ static int das08_ai_insn_read(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { - const struct das08_board_struct *thisboard = dev->board_ptr; + const struct das08_board_struct *board = dev->board_ptr; struct das08_private_struct *devpriv = dev->private; int n; int chan; @@ -210,7 +210,7 @@ static int das08_ai_insn_read(struct comedi_device *dev, for (n = 0; n < insn->n; n++) { /* clear over-range bits for 16-bit boards */ - if (thisboard->ai_nbits == 16) + if (board->ai_nbits == 16) if (inb(dev->iobase + DAS08_AI_MSB_REG) & 0x80) dev_info(dev->class_dev, "over-range\n"); @@ -223,11 +223,11 @@ static int das08_ai_insn_read(struct comedi_device *dev, msb = inb(dev->iobase + DAS08_AI_MSB_REG); lsb = inb(dev->iobase + DAS08_AI_LSB_REG); - if (thisboard->ai_encoding == das08_encode12) { + if (board->ai_encoding == das08_encode12) { data[n] = (lsb >> 4) | (msb << 4); - } else if (thisboard->ai_encoding == das08_pcm_encode12) { + } else if (board->ai_encoding == das08_pcm_encode12) { data[n] = (msb << 8) + lsb; - } else if (thisboard->ai_encoding == das08_encode16) { + } else if (board->ai_encoding == das08_encode16) { /* * "JR" 16-bit boards are sign-magnitude. * @@ -312,13 +312,13 @@ static int das08jr_do_insn_bits(struct comedi_device *dev, static void das08_ao_set_data(struct comedi_device *dev, unsigned int chan, unsigned int data) { - const struct das08_board_struct *thisboard = dev->board_ptr; + const struct das08_board_struct *board = dev->board_ptr; unsigned char lsb; unsigned char msb; lsb = data & 0xff; msb = (data >> 8) & 0xff; - if (thisboard->is_jr) { + if (board->is_jr) { outb(lsb, dev->iobase + DAS08JR_AO_LSB_REG(chan)); outb(msb, dev->iobase + DAS08JR_AO_MSB_REG(chan)); /* load DACs */ @@ -351,7 +351,7 @@ static int das08_ao_insn_write(struct comedi_device *dev, int das08_common_attach(struct comedi_device *dev, unsigned long iobase) { - const struct das08_board_struct *thisboard = dev->board_ptr; + const struct das08_board_struct *board = dev->board_ptr; struct das08_private_struct *devpriv = dev->private; struct comedi_subdevice *s; int ret; @@ -359,7 +359,7 @@ int das08_common_attach(struct comedi_device *dev, unsigned long iobase) dev->iobase = iobase; - dev->board_name = thisboard->name; + dev->board_name = board->name; ret = comedi_alloc_subdevices(dev, 6); if (ret) @@ -367,7 +367,7 @@ int das08_common_attach(struct comedi_device *dev, unsigned long iobase) s = &dev->subdevices[0]; /* ai */ - if (thisboard->ai_nbits) { + if (board->ai_nbits) { s->type = COMEDI_SUBD_AI; /* * XXX some boards actually have differential @@ -377,21 +377,21 @@ int das08_common_attach(struct comedi_device *dev, unsigned long iobase) */ s->subdev_flags = SDF_READABLE | SDF_GROUND; s->n_chan = 8; - s->maxdata = (1 << thisboard->ai_nbits) - 1; - s->range_table = das08_ai_lranges[thisboard->ai_pg]; + s->maxdata = (1 << board->ai_nbits) - 1; + s->range_table = das08_ai_lranges[board->ai_pg]; s->insn_read = das08_ai_insn_read; - devpriv->pg_gainlist = das08_ai_gainlists[thisboard->ai_pg]; + devpriv->pg_gainlist = das08_ai_gainlists[board->ai_pg]; } else { s->type = COMEDI_SUBD_UNUSED; } s = &dev->subdevices[1]; /* ao */ - if (thisboard->ao_nbits) { + if (board->ao_nbits) { s->type = COMEDI_SUBD_AO; s->subdev_flags = SDF_WRITABLE; s->n_chan = 2; - s->maxdata = (1 << thisboard->ao_nbits) - 1; + s->maxdata = (1 << board
[PATCH 18/22] staging: comedi: dt3000: rename 'this_board' variables
For aesthetics, rename the 'this_board' variables to 'board'. That name is more commonly used for the boardinfo pointer in comedi drivers. Signed-off-by: H Hartley Sweeten --- drivers/staging/comedi/drivers/dt3000.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c index 031282c..8c4f284 100644 --- a/drivers/staging/comedi/drivers/dt3000.c +++ b/drivers/staging/comedi/drivers/dt3000.c @@ -400,7 +400,7 @@ static int dt3k_ns_to_timer(unsigned int timer_base, unsigned int *nanosec, static int dt3k_ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_cmd *cmd) { - const struct dt3k_boardtype *this_board = dev->board_ptr; + const struct dt3k_boardtype *board = dev->board_ptr; int err = 0; unsigned int arg; @@ -424,14 +424,14 @@ static int dt3k_ai_cmdtest(struct comedi_device *dev, if (cmd->scan_begin_src == TRIG_TIMER) { err |= comedi_check_trigger_arg_min(&cmd->scan_begin_arg, - this_board->ai_speed); + board->ai_speed); err |= comedi_check_trigger_arg_max(&cmd->scan_begin_arg, 100 * 16 * 65535); } if (cmd->convert_src == TRIG_TIMER) { err |= comedi_check_trigger_arg_min(&cmd->convert_arg, - this_board->ai_speed); + board->ai_speed); err |= comedi_check_trigger_arg_max(&cmd->convert_arg, 50 * 16 * 65535); } @@ -635,17 +635,17 @@ static int dt3000_auto_attach(struct comedi_device *dev, unsigned long context) { struct pci_dev *pcidev = comedi_to_pci_dev(dev); - const struct dt3k_boardtype *this_board = NULL; + const struct dt3k_boardtype *board = NULL; struct dt3k_private *devpriv; struct comedi_subdevice *s; int ret = 0; if (context < ARRAY_SIZE(dt3k_boardtypes)) - this_board = &dt3k_boardtypes[context]; - if (!this_board) + board = &dt3k_boardtypes[context]; + if (!board) return -ENODEV; - dev->board_ptr = this_board; - dev->board_name = this_board->name; + dev->board_ptr = board; + dev->board_name = board->name; devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv)); if (!devpriv) @@ -674,9 +674,9 @@ static int dt3000_auto_attach(struct comedi_device *dev, /* ai subdevice */ s->type = COMEDI_SUBD_AI; s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_DIFF; - s->n_chan = this_board->adchan; + s->n_chan = board->adchan; s->insn_read= dt3k_ai_insn; - s->maxdata = (1 << this_board->adbits) - 1; + s->maxdata = (1 << board->adbits) - 1; s->range_table = &range_dt3000_ai; /* XXX */ if (dev->irq) { dev->read_subdev = s; @@ -692,7 +692,7 @@ static int dt3000_auto_attach(struct comedi_device *dev, s->type = COMEDI_SUBD_AO; s->subdev_flags = SDF_WRITABLE; s->n_chan = 2; - s->maxdata = (1 << this_board->dabits) - 1; + s->maxdata = (1 << board->dabits) - 1; s->len_chanlist = 1; s->range_table = &range_bipolar10; s->insn_write = dt3k_ao_insn_write; -- 2.4.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 17/22] staging: comedi: adv_pci_dio: rename 'this_board' variables
For aesthetics, rename the 'this_board' variables to 'board'. That name is more commonly used for the boardinfo pointer in comedi drivers. Signed-off-by: H Hartley Sweeten --- drivers/staging/comedi/drivers/adv_pci_dio.c | 48 ++-- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/staging/comedi/drivers/adv_pci_dio.c b/drivers/staging/comedi/drivers/adv_pci_dio.c index 456e870..f1b3c5a 100644 --- a/drivers/staging/comedi/drivers/adv_pci_dio.c +++ b/drivers/staging/comedi/drivers/adv_pci_dio.c @@ -732,9 +732,9 @@ static int pci1760_reset(struct comedi_device *dev) */ static int pci_dio_reset(struct comedi_device *dev) { - const struct dio_boardtype *this_board = dev->board_ptr; + const struct dio_boardtype *board = dev->board_ptr; - switch (this_board->cardtype) { + switch (board->cardtype) { case TYPE_PCI1730: outb(0, dev->iobase + PCI1730_DO); /* clear outputs */ outb(0, dev->iobase + PCI1730_DO + 1); @@ -887,7 +887,7 @@ static int pci_dio_add_di(struct comedi_device *dev, struct comedi_subdevice *s, const struct diosubd_data *d) { - const struct dio_boardtype *this_board = dev->board_ptr; + const struct dio_boardtype *board = dev->board_ptr; s->type = COMEDI_SUBD_DI; s->subdev_flags = SDF_READABLE | d->specflags; @@ -897,7 +897,7 @@ static int pci_dio_add_di(struct comedi_device *dev, s->maxdata = 1; s->len_chanlist = d->chans; s->range_table = &range_digital; - switch (this_board->io_access) { + switch (board->io_access) { case IO_8b: s->insn_bits = pci_dio_insn_bits_di_b; break; @@ -917,7 +917,7 @@ static int pci_dio_add_do(struct comedi_device *dev, struct comedi_subdevice *s, const struct diosubd_data *d) { - const struct dio_boardtype *this_board = dev->board_ptr; + const struct dio_boardtype *board = dev->board_ptr; s->type = COMEDI_SUBD_DO; s->subdev_flags = SDF_WRITABLE; @@ -928,7 +928,7 @@ static int pci_dio_add_do(struct comedi_device *dev, s->len_chanlist = d->chans; s->range_table = &range_digital; s->state = 0; - switch (this_board->io_access) { + switch (board->io_access) { case IO_8b: s->insn_bits = pci_dio_insn_bits_do_b; break; @@ -978,17 +978,17 @@ static int pci_dio_auto_attach(struct comedi_device *dev, unsigned long context) { struct pci_dev *pcidev = comedi_to_pci_dev(dev); - const struct dio_boardtype *this_board = NULL; + const struct dio_boardtype *board = NULL; struct pci_dio_private *devpriv; struct comedi_subdevice *s; int ret, subdev, i, j; if (context < ARRAY_SIZE(boardtypes)) - this_board = &boardtypes[context]; - if (!this_board) + board = &boardtypes[context]; + if (!board) return -ENODEV; - dev->board_ptr = this_board; - dev->board_name = this_board->name; + dev->board_ptr = board; + dev->board_name = board->name; devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv)); if (!devpriv) @@ -997,50 +997,50 @@ static int pci_dio_auto_attach(struct comedi_device *dev, ret = comedi_pci_enable(dev); if (ret) return ret; - dev->iobase = pci_resource_start(pcidev, this_board->main_pci_region); + dev->iobase = pci_resource_start(pcidev, board->main_pci_region); - ret = comedi_alloc_subdevices(dev, this_board->nsubdevs); + ret = comedi_alloc_subdevices(dev, board->nsubdevs); if (ret) return ret; subdev = 0; for (i = 0; i < MAX_DI_SUBDEVS; i++) - if (this_board->sdi[i].chans) { + if (board->sdi[i].chans) { s = &dev->subdevices[subdev]; - pci_dio_add_di(dev, s, &this_board->sdi[i]); + pci_dio_add_di(dev, s, &board->sdi[i]); subdev++; } for (i = 0; i < MAX_DO_SUBDEVS; i++) - if (this_board->sdo[i].chans) { + if (board->sdo[i].chans) { s = &dev->subdevices[subdev]; - pci_dio_add_do(dev, s, &this_board->sdo[i]); + pci_dio_add_do(dev, s, &board->sdo[i]); subdev++; } for (i = 0; i < MAX_DIO_SUBDEVG; i++) - for (j = 0; j < this_board->sdio[i].regs; j++) { + for (j = 0; j < board->sdio[i].regs; j++) { s = &dev->subdevices[subdev]; ret = subdev_8255_init(dev, s, NULL, - this_b
[PATCH 12/22] staging: comedi: das1800: cleanup das1800_probe()
Make this function return a pointer to the boardinfo instead of an index. Since it's not typical, add a comment to clarify why this legacy driver does a probe. Signed-off-by: H Hartley Sweeten --- drivers/staging/comedi/drivers/das1800.c | 44 +--- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/drivers/staging/comedi/drivers/das1800.c b/drivers/staging/comedi/drivers/das1800.c index 53baf37..a7471bb 100644 --- a/drivers/staging/comedi/drivers/das1800.c +++ b/drivers/staging/comedi/drivers/das1800.c @@ -1216,62 +1216,67 @@ static void das1800_free_dma(struct comedi_device *dev) comedi_isadma_free(devpriv->dma); } -static int das1800_probe(struct comedi_device *dev) +static const struct das1800_board *das1800_probe(struct comedi_device *dev) { const struct das1800_board *board = dev->board_ptr; - int index; + int index = board ? board - das1800_boards : -EINVAL; int id; - /* calc the offset to the boardinfo that was found by the core */ - index = board - das1800_boards; - - /* verify that the board id matches the boardinfo */ + /* +* The dev->board_ptr will be set by comedi_device_attach() if the +* board name provided by the user matches a board->name in this +* driver. If so, this function sanity checks the id to verify that +* the board is correct. +* +* If the dev->board_ptr is not set, the user is trying to attach +* an unspecified board to this driver. In this case the id is used +* to 'probe' for the correct dev->board_ptr. +*/ id = (inb(dev->iobase + DAS1800_DIGITAL) >> 4) & 0xf; switch (id) { case 0x3: if (index == das1801st_da || index == das1802st_da || index == das1701st_da || index == das1702st_da) - return index; + return board; index = das1801st; break; case 0x4: if (index == das1802hr_da || index == das1702hr_da) - return index; + return board; index = das1802hr; break; case 0x5: if (index == das1801ao || index == das1802ao || index == das1701ao || index == das1702ao) - return index; + return board; index = das1801ao; break; case 0x6: if (index == das1802hr || index == das1702hr) - return index; + return board; index = das1802hr; break; case 0x7: if (index == das1801st || index == das1802st || index == das1701st || index == das1702st) - return index; + return board; index = das1801st; break; case 0x8: if (index == das1801hc || index == das1802hc) - return index; + return board; index = das1801hc; - break; default: dev_err(dev->class_dev, "Board model: probe returned 0x%x (unknown, please report)\n", id); - break; + return NULL; } dev_err(dev->class_dev, "Board model (probed, not recommended): %s series\n", das1800_boards[index].name); - return index; + return &das1800_boards[index]; } static int das1800_attach(struct comedi_device *dev, @@ -1281,7 +1286,6 @@ static int das1800_attach(struct comedi_device *dev, struct das1800_private *devpriv; struct comedi_subdevice *s; unsigned int irq = it->options[1]; - int board; int ret; devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv)); @@ -1292,14 +1296,12 @@ static int das1800_attach(struct comedi_device *dev, if (ret) return ret; - board = das1800_probe(dev); - if (board < 0) { + thisboard = das1800_probe(dev); + if (!thisboard) { dev_err(dev->class_dev, "unable to determine board type\n"); return -ENODEV; } - - dev->board_ptr = das1800_boards + board; - thisboard = dev->board_ptr; + dev->board_ptr = thisboard; dev->board_name = thisboard->name; /* if it is an 'ao' board with fancy analog out then we need extra io ports */ -- 2.4.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/22] staging: comedi: das800: rename 'thisboard' variables
For aesthetics, rename the 'thisboard' variables to 'board'. That name is more commonly used for the boardinfo pointer in comedi drivers. Signed-off-by: H Hartley Sweeten --- drivers/staging/comedi/drivers/das800.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/comedi/drivers/das800.c b/drivers/staging/comedi/drivers/das800.c index 9f553f7..b02f122 100644 --- a/drivers/staging/comedi/drivers/das800.c +++ b/drivers/staging/comedi/drivers/das800.c @@ -240,13 +240,13 @@ static unsigned das800_ind_read(struct comedi_device *dev, unsigned reg) static void das800_enable(struct comedi_device *dev) { - const struct das800_board *thisboard = dev->board_ptr; + const struct das800_board *board = dev->board_ptr; struct das800_private *devpriv = dev->private; unsigned long irq_flags; spin_lock_irqsave(&dev->spinlock, irq_flags); /* enable fifo-half full interrupts for cio-das802/16 */ - if (thisboard->resolution == 16) + if (board->resolution == 16) outb(CIO_ENHF, dev->iobase + DAS800_GAIN); /* enable hardware triggering */ das800_ind_write(dev, CONV_HCEN, CONV_CONTROL); @@ -303,7 +303,7 @@ static int das800_ai_do_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_cmd *cmd) { - const struct das800_board *thisboard = dev->board_ptr; + const struct das800_board *board = dev->board_ptr; int err = 0; /* Step 1 : check if triggers are trivially valid */ @@ -335,7 +335,7 @@ static int das800_ai_do_cmdtest(struct comedi_device *dev, if (cmd->convert_src == TRIG_TIMER) { err |= comedi_check_trigger_arg_min(&cmd->convert_arg, - thisboard->ai_speed); + board->ai_speed); } err |= comedi_check_trigger_arg_min(&cmd->chanlist_len, 1); @@ -375,7 +375,7 @@ static int das800_ai_do_cmdtest(struct comedi_device *dev, static int das800_ai_do_cmd(struct comedi_device *dev, struct comedi_subdevice *s) { - const struct das800_board *thisboard = dev->board_ptr; + const struct das800_board *board = dev->board_ptr; struct comedi_async *async = s->async; struct comedi_cmd *cmd = &async->cmd; unsigned int gain = CR_RANGE(cmd->chanlist[0]); @@ -393,7 +393,7 @@ static int das800_ai_do_cmd(struct comedi_device *dev, spin_unlock_irqrestore(&dev->spinlock, irq_flags); /* set gain */ - if (thisboard->resolution == 12 && gain > 0) + if (board->resolution == 12 && gain > 0) gain += 0x7; gain &= 0xf; outb(gain, dev->iobase + DAS800_GAIN); -- 2.4.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/22] staging: comedi: ni_at_a2150: rename 'thisboard' variables
For aesthetics, rename the 'thisboard' variables to 'board'. That name is more commonly used for the boardinfo pointer in comedi drivers. Signed-off-by: H Hartley Sweeten --- drivers/staging/comedi/drivers/ni_at_a2150.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_at_a2150.c b/drivers/staging/comedi/drivers/ni_at_a2150.c index 1cd4869..9b444f8 100644 --- a/drivers/staging/comedi/drivers/ni_at_a2150.c +++ b/drivers/staging/comedi/drivers/ni_at_a2150.c @@ -264,7 +264,7 @@ static int a2150_cancel(struct comedi_device *dev, struct comedi_subdevice *s) static int a2150_get_timing(struct comedi_device *dev, unsigned int *period, unsigned int flags) { - const struct a2150_board *thisboard = dev->board_ptr; + const struct a2150_board *board = dev->board_ptr; struct a2150_private *devpriv = dev->private; int lub, glb, temp; int lub_divisor_shift, lub_index, glb_divisor_shift, glb_index; @@ -273,10 +273,10 @@ static int a2150_get_timing(struct comedi_device *dev, unsigned int *period, /* initialize greatest lower and least upper bounds */ lub_divisor_shift = 3; lub_index = 0; - lub = thisboard->clock[lub_index] * (1 << lub_divisor_shift); + lub = board->clock[lub_index] * (1 << lub_divisor_shift); glb_divisor_shift = 0; - glb_index = thisboard->num_clocks - 1; - glb = thisboard->clock[glb_index] * (1 << glb_divisor_shift); + glb_index = board->num_clocks - 1; + glb = board->clock[glb_index] * (1 << glb_divisor_shift); /* make sure period is in available range */ if (*period < glb) @@ -287,9 +287,9 @@ static int a2150_get_timing(struct comedi_device *dev, unsigned int *period, /* we can multiply period by 1, 2, 4, or 8, using (1 << i) */ for (i = 0; i < 4; i++) { /* there are a maximum of 4 master clocks */ - for (j = 0; j < thisboard->num_clocks; j++) { + for (j = 0; j < board->num_clocks; j++) { /* temp is the period in nanosec we are evaluating */ - temp = thisboard->clock[j] * (1 << i); + temp = board->clock[j] * (1 << i); /* if it is the best match yet */ if (temp < lub && temp >= *period) { lub_divisor_shift = i; @@ -413,7 +413,7 @@ static int a2150_ai_check_chanlist(struct comedi_device *dev, static int a2150_ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_cmd *cmd) { - const struct a2150_board *thisboard = dev->board_ptr; + const struct a2150_board *board = dev->board_ptr; int err = 0; unsigned int arg; @@ -444,7 +444,7 @@ static int a2150_ai_cmdtest(struct comedi_device *dev, if (cmd->convert_src == TRIG_TIMER) { err |= comedi_check_trigger_arg_min(&cmd->convert_arg, - thisboard->ai_speed); + board->ai_speed); } err |= comedi_check_trigger_arg_min(&cmd->chanlist_len, 1); @@ -699,7 +699,7 @@ static const struct a2150_board *a2150_probe(struct comedi_device *dev) static int a2150_attach(struct comedi_device *dev, struct comedi_devconfig *it) { - const struct a2150_board *thisboard; + const struct a2150_board *board; struct a2150_private *devpriv; struct comedi_subdevice *s; static const int timeout = 2000; @@ -714,11 +714,11 @@ static int a2150_attach(struct comedi_device *dev, struct comedi_devconfig *it) if (ret) return ret; - thisboard = a2150_probe(dev); - if (!thisboard) + board = a2150_probe(dev); + if (!board) return -ENODEV; - dev->board_ptr = thisboard; - dev->board_name = thisboard->name; + dev->board_ptr = board; + dev->board_name = board->name; /* an IRQ and DMA are required to support async commands */ a2150_alloc_irq_and_dma(dev, it); -- 2.4.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/22] staging: comedi: das08_isa: rename 'thisboard' variables
For aesthetics, rename the 'thisboard' variables to 'board'. That name is more commonly used for the boardinfo pointer in comedi drivers. Signed-off-by: H Hartley Sweeten --- drivers/staging/comedi/drivers/das08_isa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/das08_isa.c b/drivers/staging/comedi/drivers/das08_isa.c index 2d9a31d..cdefc99 100644 --- a/drivers/staging/comedi/drivers/das08_isa.c +++ b/drivers/staging/comedi/drivers/das08_isa.c @@ -168,7 +168,7 @@ static const struct das08_board_struct das08_isa_boards[] = { static int das08_isa_attach(struct comedi_device *dev, struct comedi_devconfig *it) { - const struct das08_board_struct *thisboard = dev->board_ptr; + const struct das08_board_struct *board = dev->board_ptr; struct das08_private_struct *devpriv; int ret; @@ -176,7 +176,7 @@ static int das08_isa_attach(struct comedi_device *dev, if (!devpriv) return -ENOMEM; - ret = comedi_request_region(dev, it->options[0], thisboard->iosize); + ret = comedi_request_region(dev, it->options[0], board->iosize); if (ret) return ret; -- 2.4.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/22] staging: comedi: das800: cleanup das800_probe()
Make this function return a pointer to the boardinfo instead of an index. Since it's not typical, add a comment to clarify why this legacy driver does a probe. Consolidate the dev_dbg() messages when a probed boardinfo is used and remove the extra dev_dbg() message when the boardinfo is not found. Signed-off-by: H Hartley Sweeten --- drivers/staging/comedi/drivers/das800.c | 63 ++--- 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/drivers/staging/comedi/drivers/das800.c b/drivers/staging/comedi/drivers/das800.c index 39d304a..9f553f7 100644 --- a/drivers/staging/comedi/drivers/das800.c +++ b/drivers/staging/comedi/drivers/das800.c @@ -604,54 +604,62 @@ static int das800_do_insn_bits(struct comedi_device *dev, return insn->n; } -static int das800_probe(struct comedi_device *dev) +static const struct das800_board *das800_probe(struct comedi_device *dev) { - const struct das800_board *thisboard = dev->board_ptr; - int board = thisboard ? thisboard - das800_boards : -EINVAL; + const struct das800_board *board = dev->board_ptr; + int index = board ? board - das800_boards : -EINVAL; int id_bits; unsigned long irq_flags; + /* +* The dev->board_ptr will be set by comedi_device_attach() if the +* board name provided by the user matches a board->name in this +* driver. If so, this function sanity checks the id_bits to verify +* that the board is correct. +* +* If the dev->board_ptr is not set, the user is trying to attach +* an unspecified board to this driver. In this case the id_bits +* are used to 'probe' for the correct dev->board_ptr. +*/ spin_lock_irqsave(&dev->spinlock, irq_flags); id_bits = das800_ind_read(dev, ID) & 0x3; spin_unlock_irqrestore(&dev->spinlock, irq_flags); switch (id_bits) { case 0x0: - if (board == BOARD_DAS800 || board == BOARD_CIODAS800) - break; - dev_dbg(dev->class_dev, "Board model (probed): DAS-800\n"); - board = BOARD_DAS800; + if (index == BOARD_DAS800 || index == BOARD_CIODAS800) + return board; + index = BOARD_DAS800; break; case 0x2: - if (board == BOARD_DAS801 || board == BOARD_CIODAS801) - break; - dev_dbg(dev->class_dev, "Board model (probed): DAS-801\n"); - board = BOARD_DAS801; + if (index == BOARD_DAS801 || index == BOARD_CIODAS801) + return board; + index = BOARD_DAS801; break; case 0x3: - if (board == BOARD_DAS802 || board == BOARD_CIODAS802 || - board == BOARD_CIODAS80216) - break; - dev_dbg(dev->class_dev, "Board model (probed): DAS-802\n"); - board = BOARD_DAS802; + if (index == BOARD_DAS802 || index == BOARD_CIODAS802 || + index == BOARD_CIODAS80216) + return board; + index = BOARD_DAS802; break; default: dev_dbg(dev->class_dev, "Board model: 0x%x (unknown)\n", id_bits); - board = -EINVAL; - break; + return NULL; } - return board; + dev_dbg(dev->class_dev, "Board model (probed): %s series\n", + das800_boards[index].name); + + return &das800_boards[index]; } static int das800_attach(struct comedi_device *dev, struct comedi_devconfig *it) { - const struct das800_board *thisboard; + const struct das800_board *board; struct das800_private *devpriv; struct comedi_subdevice *s; unsigned int irq = it->options[1]; unsigned long irq_flags; - int board; int ret; devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv)); @@ -663,13 +671,10 @@ static int das800_attach(struct comedi_device *dev, struct comedi_devconfig *it) return ret; board = das800_probe(dev); - if (board < 0) { - dev_dbg(dev->class_dev, "unable to determine board type\n"); + if (!board) return -ENODEV; - } - dev->board_ptr = das800_boards + board; - thisboard = dev->board_ptr; - dev->board_name = thisboard->name; + dev->board_ptr = board; + dev->board_name = board->name; if (irq > 1 && irq <= 7) { ret = request_irq(irq, das800_interrupt, 0, dev->board_name, @@ -693,8 +698,8 @@ static int das800_attach(struct comedi_device *dev, struct comedi_devconfig *it) s->type = COMEDI_SUBD_AI; s->subdev_flags = SDF_READABLE | SDF_GROUND; s->n_chan = 8; - s->maxdata = (1 << thisboard->resolution) -
[PATCH 20/22] staging: comedi: ni_atmio: cleanup ni_getboardtype()
Make this function return a pointer to the boardinfo instead of an index. For aesthetics, rename the function to ni_atmio_probe(). Signed-off-by: H Hartley Sweeten --- drivers/staging/comedi/drivers/ni_atmio.c | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_atmio.c b/drivers/staging/comedi/drivers/ni_atmio.c index 1304b06..b43b8ce 100644 --- a/drivers/staging/comedi/drivers/ni_atmio.c +++ b/drivers/staging/comedi/drivers/ni_atmio.c @@ -274,14 +274,15 @@ static int ni_isapnp_find_board(struct pnp_dev **dev) return 0; } -static int ni_getboardtype(struct comedi_device *dev) +static const struct ni_board_struct *ni_atmio_probe(struct comedi_device *dev) { int device_id = ni_read_eeprom(dev, 511); int i; for (i = 0; i < ARRAY_SIZE(ni_boards); i++) { - if (ni_boards[i].device_id == device_id) - return i; + const struct ni_board_struct *board = &ni_boards[i]; + if (board->device_id == device_id) + return board; } if (device_id == 255) dev_err(dev->class_dev, "can't find board\n"); @@ -292,17 +293,16 @@ static int ni_getboardtype(struct comedi_device *dev) dev_err(dev->class_dev, "unknown device ID %d -- contact author\n", device_id); - return -1; + return NULL; } static int ni_atmio_attach(struct comedi_device *dev, struct comedi_devconfig *it) { - const struct ni_board_struct *boardtype; + const struct ni_board_struct *board; struct pnp_dev *isapnp_dev; int ret; unsigned long iobase; - int board; unsigned int irq; ret = ni_alloc_private(dev); @@ -326,15 +326,11 @@ static int ni_atmio_attach(struct comedi_device *dev, if (ret) return ret; - /* get board type */ - - board = ni_getboardtype(dev); - if (board < 0) - return -EIO; - - dev->board_ptr = ni_boards + board; - boardtype = dev->board_ptr; - dev->board_name = boardtype->name; + board = ni_atmio_probe(dev); + if (!board) + return -ENODEV; + dev->board_ptr = board; + dev->board_name = board->name; /* irq stuff */ -- 2.4.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 15/22] staging: comedi: cb_pcidas: rename 'thisboard' variables
For aesthetics, rename the 'thisboard' variables to 'board'. That name is more commonly used for the boardinfo pointer in comedi drivers. Signed-off-by: H Hartley Sweeten --- drivers/staging/comedi/drivers/cb_pcidas.c | 64 +++--- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/drivers/staging/comedi/drivers/cb_pcidas.c b/drivers/staging/comedi/drivers/cb_pcidas.c index e3591a5..b43e836 100644 --- a/drivers/staging/comedi/drivers/cb_pcidas.c +++ b/drivers/staging/comedi/drivers/cb_pcidas.c @@ -705,9 +705,9 @@ static int trimpot_8402_write(struct comedi_device *dev, unsigned int channel, static void cb_pcidas_trimpot_write(struct comedi_device *dev, unsigned int chan, unsigned int val) { - const struct cb_pcidas_board *thisboard = dev->board_ptr; + const struct cb_pcidas_board *board = dev->board_ptr; - switch (thisboard->trimpot) { + switch (board->trimpot) { case AD7376: trimpot_7376_write(dev, val); break; @@ -770,7 +770,7 @@ static int cb_pcidas_ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_cmd *cmd) { - const struct cb_pcidas_board *thisboard = dev->board_ptr; + const struct cb_pcidas_board *board = dev->board_ptr; int err = 0; unsigned int arg; @@ -821,7 +821,7 @@ static int cb_pcidas_ai_cmdtest(struct comedi_device *dev, ~(CR_EDGE | CR_INVERT)); err |= -EINVAL; } - if (!thisboard->is_1602 && (cmd->start_arg & CR_INVERT)) { + if (!board->is_1602 && (cmd->start_arg & CR_INVERT)) { cmd->start_arg &= (CR_FLAGS_MASK & ~CR_INVERT); err |= -EINVAL; } @@ -830,13 +830,13 @@ static int cb_pcidas_ai_cmdtest(struct comedi_device *dev, if (cmd->scan_begin_src == TRIG_TIMER) { err |= comedi_check_trigger_arg_min(&cmd->scan_begin_arg, - thisboard->ai_speed * + board->ai_speed * cmd->chanlist_len); } if (cmd->convert_src == TRIG_TIMER) { err |= comedi_check_trigger_arg_min(&cmd->convert_arg, - thisboard->ai_speed); + board->ai_speed); } err |= comedi_check_trigger_arg_is(&cmd->scan_end_arg, @@ -879,7 +879,7 @@ static int cb_pcidas_ai_cmdtest(struct comedi_device *dev, static int cb_pcidas_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) { - const struct cb_pcidas_board *thisboard = dev->board_ptr; + const struct cb_pcidas_board *board = dev->board_ptr; struct cb_pcidas_private *devpriv = dev->private; struct comedi_async *async = s->async; struct comedi_cmd *cmd = &async->cmd; @@ -945,7 +945,7 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev, bits |= SW_TRIGGER; } else {/* TRIG_EXT */ bits |= EXT_TRIGGER | TGEN | XTRCL; - if (thisboard->is_1602) { + if (board->is_1602) { if (cmd->start_arg & CR_INVERT) bits |= TGPOL; if (cmd->start_arg & CR_EDGE) @@ -982,7 +982,7 @@ static int cb_pcidas_ao_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_cmd *cmd) { - const struct cb_pcidas_board *thisboard = dev->board_ptr; + const struct cb_pcidas_board *board = dev->board_ptr; struct cb_pcidas_private *devpriv = dev->private; int err = 0; @@ -1014,7 +1014,7 @@ static int cb_pcidas_ao_cmdtest(struct comedi_device *dev, if (cmd->scan_begin_src == TRIG_TIMER) { err |= comedi_check_trigger_arg_min(&cmd->scan_begin_arg, - thisboard->ao_scan_speed); + board->ao_scan_speed); } err |= comedi_check_trigger_arg_is(&cmd->scan_end_arg, @@ -1090,7 +1090,7 @@ static int cb_pcidas_ao_inttrig(struct comedi_device *dev, struct comedi_subdevice *s, unsigned int trig_num) { - const struct cb_pcidas_board *thisboard = dev->board_ptr; + const struct cb_pcidas_board *board = dev->board_ptr; struct cb_pcidas_private *devpriv = dev->private; struct comedi_async *async = s->async; struct comedi_cmd *cmd = &async->cmd; @@ -1099,7 +1099,7 @@ static int cb_pcidas_ao_inttrig(struct come
[PATCH 14/22] staging: comedi: me4000: rename 'thisboard' variables
For aesthetics, rename the 'thisboard' variables to 'board'. That name is more commonly used for the boardinfo pointer in comedi drivers. Signed-off-by: H Hartley Sweeten --- drivers/staging/comedi/drivers/me4000.c | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/staging/comedi/drivers/me4000.c b/drivers/staging/comedi/drivers/me4000.c index 7a8c27d..a8f3ca4 100644 --- a/drivers/staging/comedi/drivers/me4000.c +++ b/drivers/staging/comedi/drivers/me4000.c @@ -453,7 +453,7 @@ static int me4000_ai_insn_read(struct comedi_device *dev, struct comedi_subdevice *subdevice, struct comedi_insn *insn, unsigned int *data) { - const struct me4000_board *thisboard = dev->board_ptr; + const struct me4000_board *board = dev->board_ptr; int chan = CR_CHAN(insn->chanspec); int rang = CR_RANGE(insn->chanspec); int aref = CR_AREF(insn->chanspec); @@ -491,7 +491,7 @@ static int me4000_ai_insn_read(struct comedi_device *dev, switch (aref) { case AREF_GROUND: case AREF_COMMON: - if (chan >= thisboard->ai_nchan) { + if (chan >= board->ai_nchan) { dev_err(dev->class_dev, "Analog input is not available\n"); return -EINVAL; @@ -506,7 +506,7 @@ static int me4000_ai_insn_read(struct comedi_device *dev, return -EINVAL; } - if (chan >= thisboard->ai_diff_nchan) { + if (chan >= board->ai_diff_nchan) { dev_err(dev->class_dev, "Analog input is not available\n"); return -EINVAL; @@ -1252,17 +1252,17 @@ static int me4000_auto_attach(struct comedi_device *dev, unsigned long context) { struct pci_dev *pcidev = comedi_to_pci_dev(dev); - const struct me4000_board *thisboard = NULL; + const struct me4000_board *board = NULL; struct me4000_info *info; struct comedi_subdevice *s; int result; if (context < ARRAY_SIZE(me4000_boards)) - thisboard = &me4000_boards[context]; - if (!thisboard) + board = &me4000_boards[context]; + if (!board) return -ENODEV; - dev->board_ptr = thisboard; - dev->board_name = thisboard->name; + dev->board_ptr = board; + dev->board_name = board->name; info = comedi_alloc_devpriv(dev, sizeof(*info)); if (!info) @@ -1301,11 +1301,11 @@ static int me4000_auto_attach(struct comedi_device *dev, s = &dev->subdevices[0]; - if (thisboard->ai_nchan) { + if (board->ai_nchan) { s->type = COMEDI_SUBD_AI; s->subdev_flags = SDF_READABLE | SDF_COMMON | SDF_GROUND | SDF_DIFF; - s->n_chan = thisboard->ai_nchan; + s->n_chan = board->ai_nchan; s->maxdata = 0x;/* 16 bit ADC */ s->len_chanlist = ME4000_AI_CHANNEL_LIST_COUNT; s->range_table = &me4000_ai_range; @@ -1328,10 +1328,10 @@ static int me4000_auto_attach(struct comedi_device *dev, s = &dev->subdevices[1]; - if (thisboard->ao_nchan) { + if (board->ao_nchan) { s->type = COMEDI_SUBD_AO; s->subdev_flags = SDF_WRITABLE | SDF_COMMON | SDF_GROUND; - s->n_chan = thisboard->ao_nchan; + s->n_chan = board->ao_nchan; s->maxdata = 0x;/* 16 bit DAC */ s->range_table = &range_bipolar10; s->insn_write = me4000_ao_insn_write; @@ -1349,10 +1349,10 @@ static int me4000_auto_attach(struct comedi_device *dev, s = &dev->subdevices[2]; - if (thisboard->dio_nchan) { + if (board->dio_nchan) { s->type = COMEDI_SUBD_DIO; s->subdev_flags = SDF_READABLE | SDF_WRITABLE; - s->n_chan = thisboard->dio_nchan; + s->n_chan = board->dio_nchan; s->maxdata = 1; s->range_table = &range_digital; s->insn_bits = me4000_dio_insn_bits; @@ -1373,7 +1373,7 @@ static int me4000_auto_attach(struct comedi_device *dev, /* Counter subdevice (8254) */ s = &dev->subdevices[3]; - if (thisboard->has_counter) { + if (board->has_counter) { unsigned long timer_base = pci_resource_start(pcidev, 3); if (!timer_base) -- 2.4.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/22] staging: comedi: das1800: rename 'thisboard' variables
For aesthetics, rename the 'thisboard' variables to 'board'. That name is more commonly used for the boardinfo pointer in comedi drivers. Signed-off-by: H Hartley Sweeten --- drivers/staging/comedi/drivers/das1800.c | 50 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/drivers/staging/comedi/drivers/das1800.c b/drivers/staging/comedi/drivers/das1800.c index a7471bb..bfa4262 100644 --- a/drivers/staging/comedi/drivers/das1800.c +++ b/drivers/staging/comedi/drivers/das1800.c @@ -444,9 +444,9 @@ static const struct comedi_lrange range_ao_2 = { static inline uint16_t munge_bipolar_sample(const struct comedi_device *dev, uint16_t sample) { - const struct das1800_board *thisboard = dev->board_ptr; + const struct das1800_board *board = dev->board_ptr; - sample += 1 << (thisboard->resolution - 1); + sample += 1 << (board->resolution - 1); return sample; } @@ -725,7 +725,7 @@ static int das1800_ai_do_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_cmd *cmd) { - const struct das1800_board *thisboard = dev->board_ptr; + const struct das1800_board *board = dev->board_ptr; int err = 0; unsigned int arg; @@ -765,7 +765,7 @@ static int das1800_ai_do_cmdtest(struct comedi_device *dev, if (cmd->convert_src == TRIG_TIMER) { err |= comedi_check_trigger_arg_min(&cmd->convert_arg, - thisboard->ai_speed); + board->ai_speed); } err |= comedi_check_trigger_arg_min(&cmd->chanlist_len, 1); @@ -1048,7 +1048,7 @@ static int das1800_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { - const struct das1800_board *thisboard = dev->board_ptr; + const struct das1800_board *board = dev->board_ptr; int i, n; int chan, range, aref, chan_range; int timeout = 1000; @@ -1098,7 +1098,7 @@ static int das1800_ai_rinsn(struct comedi_device *dev, dpnt = inw(dev->iobase + DAS1800_FIFO); /* shift data to offset binary for bipolar ranges */ if ((conv_flags & UB) == 0) - dpnt += 1 << (thisboard->resolution - 1); + dpnt += 1 << (board->resolution - 1); data[n] = dpnt; } exit: @@ -1112,16 +1112,16 @@ static int das1800_ao_winsn(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { - const struct das1800_board *thisboard = dev->board_ptr; + const struct das1800_board *board = dev->board_ptr; struct das1800_private *devpriv = dev->private; int chan = CR_CHAN(insn->chanspec); /* int range = CR_RANGE(insn->chanspec); */ - int update_chan = thisboard->ao_n_chan - 1; + int update_chan = board->ao_n_chan - 1; unsigned short output; unsigned long irq_flags; /* card expects two's complement data */ - output = data[0] - (1 << (thisboard->resolution - 1)); + output = data[0] - (1 << (board->resolution - 1)); /* if the write is to the 'update' channel, we need to remember its value */ if (chan == update_chan) devpriv->ao_update_bits = output; @@ -1282,7 +1282,7 @@ static const struct das1800_board *das1800_probe(struct comedi_device *dev) static int das1800_attach(struct comedi_device *dev, struct comedi_devconfig *it) { - const struct das1800_board *thisboard; + const struct das1800_board *board; struct das1800_private *devpriv; struct comedi_subdevice *s; unsigned int irq = it->options[1]; @@ -1296,16 +1296,16 @@ static int das1800_attach(struct comedi_device *dev, if (ret) return ret; - thisboard = das1800_probe(dev); - if (!thisboard) { + board = das1800_probe(dev); + if (!board) { dev_err(dev->class_dev, "unable to determine board type\n"); return -ENODEV; } - dev->board_ptr = thisboard; - dev->board_name = thisboard->name; + dev->board_ptr = board; + dev->board_name = board->name; /* if it is an 'ao' board with fancy analog out then we need extra io ports */ - if (thisboard->ao_ability == 2) { + if (board->ao_ability == 2) { unsigned long iobase2 = dev->iobase + IOBASE2; ret = __comedi_request_region(dev, iobase2, DAS1800_SIZE); @@ -1365,11 +1365,11 @@ static int das1800_attach(struct comedi_device *dev, s = &dev->subdevices[0]; s->
[PATCH 16/22] staging: comedi: cb_pcidas64: rename 'thisboard' variables
For aesthetics, rename the 'thisboard' variables to 'board'. That name is more commonly used for the boardinfo pointer in comedi drivers. Signed-off-by: H Hartley Sweeten --- drivers/staging/comedi/drivers/cb_pcidas64.c | 218 +-- 1 file changed, 108 insertions(+), 110 deletions(-) diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c index 3d646c1..d33b8fe 100644 --- a/drivers/staging/comedi/drivers/cb_pcidas64.c +++ b/drivers/staging/comedi/drivers/cb_pcidas64.c @@ -1106,10 +1106,10 @@ static const struct pcidas64_board pcidas64_boards[] = { static inline unsigned short se_diff_bit_6xxx(struct comedi_device *dev, int use_differential) { - const struct pcidas64_board *thisboard = dev->board_ptr; + const struct pcidas64_board *board = dev->board_ptr; - if ((thisboard->layout == LAYOUT_64XX && !use_differential) || - (thisboard->layout == LAYOUT_60XX && use_differential)) + if ((board->layout == LAYOUT_64XX && !use_differential) || + (board->layout == LAYOUT_60XX && use_differential)) return ADC_SE_DIFF_BIT; return 0; @@ -1182,17 +1182,17 @@ struct pcidas64_private { static unsigned int ai_range_bits_6xxx(const struct comedi_device *dev, unsigned int range_index) { - const struct pcidas64_board *thisboard = dev->board_ptr; + const struct pcidas64_board *board = dev->board_ptr; - return thisboard->ai_range_code[range_index] << 8; + return board->ai_range_code[range_index] << 8; } static unsigned int hw_revision(const struct comedi_device *dev, uint16_t hw_status_bits) { - const struct pcidas64_board *thisboard = dev->board_ptr; + const struct pcidas64_board *board = dev->board_ptr; - if (thisboard->layout == LAYOUT_4020) + if (board->layout == LAYOUT_4020) return (hw_status_bits >> 13) & 0x7; return (hw_status_bits >> 12) & 0xf; @@ -1202,8 +1202,8 @@ static void set_dac_range_bits(struct comedi_device *dev, uint16_t *bits, unsigned int channel, unsigned int range) { - const struct pcidas64_board *thisboard = dev->board_ptr; - unsigned int code = thisboard->ao_range_code[range]; + const struct pcidas64_board *board = dev->board_ptr; + unsigned int code = board->ao_range_code[range]; if (channel > 1) dev_err(dev->class_dev, "bug! bad channel?\n"); @@ -1259,7 +1259,7 @@ static void disable_ai_interrupts(struct comedi_device *dev) static void enable_ai_interrupts(struct comedi_device *dev, const struct comedi_cmd *cmd) { - const struct pcidas64_board *thisboard = dev->board_ptr; + const struct pcidas64_board *board = dev->board_ptr; struct pcidas64_private *devpriv = dev->private; uint32_t bits; unsigned long flags; @@ -1272,7 +1272,7 @@ static void enable_ai_interrupts(struct comedi_device *dev, */ if (cmd->flags & CMDF_WAKE_EOS) { /* 4020 doesn't support pio transfers except for fifo dregs */ - if (thisboard->layout != LAYOUT_4020) + if (board->layout != LAYOUT_4020) bits |= ADC_INTR_EOSCAN_BITS | EN_ADC_INTR_SRC_BIT; } spin_lock_irqsave(&dev->spinlock, flags); @@ -1285,7 +1285,7 @@ static void enable_ai_interrupts(struct comedi_device *dev, /* initialize plx9080 chip */ static void init_plx9080(struct comedi_device *dev) { - const struct pcidas64_board *thisboard = dev->board_ptr; + const struct pcidas64_board *board = dev->board_ptr; struct pcidas64_private *devpriv = dev->private; uint32_t bits; void __iomem *plx_iobase = devpriv->plx9080_iobase; @@ -1326,12 +1326,12 @@ static void init_plx9080(struct comedi_device *dev) /* enable local burst mode */ bits |= PLX_DMA_LOCAL_BURST_EN_BIT; /* 4020 uses 32 bit dma */ - if (thisboard->layout == LAYOUT_4020) + if (board->layout == LAYOUT_4020) bits |= PLX_LOCAL_BUS_32_WIDE_BITS; else/* localspace0 bus is 16 bits wide */ bits |= PLX_LOCAL_BUS_16_WIDE_BITS; writel(bits, plx_iobase + PLX_DMA1_MODE_REG); - if (ao_cmd_is_supported(thisboard)) + if (ao_cmd_is_supported(board)) writel(bits, plx_iobase + PLX_DMA0_MODE_REG); /* enable interrupts on plx 9080 */ @@ -1363,10 +1363,10 @@ static void disable_ai_pacing(struct comedi_device *dev) static int set_ai_fifo_segment_length(struct comedi_device *dev, unsigned int num_entries) { - const struct pcidas64_board *thisboard = dev->board_ptr; + const struct pcidas64_boa
[PATCH 19/22] staging: comedi: vmk80xx: rename 'boardinfo' variables
For aesthetics, rename the 'boardinfo' variables to 'board'. That name is more commonly used for the boardinfo pointer in comedi drivers. Signed-off-by: H Hartley Sweeten --- drivers/staging/comedi/drivers/vmk80xx.c | 33 +--- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/drivers/staging/comedi/drivers/vmk80xx.c b/drivers/staging/comedi/drivers/vmk80xx.c index a090668..3af075a 100644 --- a/drivers/staging/comedi/drivers/vmk80xx.c +++ b/drivers/staging/comedi/drivers/vmk80xx.c @@ -700,7 +700,7 @@ static int vmk80xx_alloc_usb_buffers(struct comedi_device *dev) static int vmk80xx_init_subdevices(struct comedi_device *dev) { - const struct vmk80xx_board *boardinfo = dev->board_ptr; + const struct vmk80xx_board *board = dev->board_ptr; struct vmk80xx_private *devpriv = dev->private; struct comedi_subdevice *s; int n_subd; @@ -722,18 +722,18 @@ static int vmk80xx_init_subdevices(struct comedi_device *dev) s = &dev->subdevices[0]; s->type = COMEDI_SUBD_AI; s->subdev_flags = SDF_READABLE | SDF_GROUND; - s->n_chan = boardinfo->ai_nchans; - s->maxdata = boardinfo->ai_maxdata; - s->range_table = boardinfo->range; + s->n_chan = board->ai_nchans; + s->maxdata = board->ai_maxdata; + s->range_table = board->range; s->insn_read= vmk80xx_ai_insn_read; /* Analog output subdevice */ s = &dev->subdevices[1]; s->type = COMEDI_SUBD_AO; s->subdev_flags = SDF_WRITABLE | SDF_GROUND; - s->n_chan = boardinfo->ao_nchans; + s->n_chan = board->ao_nchans; s->maxdata = 0x00ff; - s->range_table = boardinfo->range; + s->range_table = board->range; s->insn_write = vmk80xx_ao_insn_write; if (devpriv->model == VMK8061_MODEL) { s->subdev_flags |= SDF_READABLE; @@ -744,7 +744,7 @@ static int vmk80xx_init_subdevices(struct comedi_device *dev) s = &dev->subdevices[2]; s->type = COMEDI_SUBD_DI; s->subdev_flags = SDF_READABLE; - s->n_chan = boardinfo->di_nchans; + s->n_chan = board->di_nchans; s->maxdata = 1; s->range_table = &range_digital; s->insn_bits= vmk80xx_di_insn_bits; @@ -763,7 +763,7 @@ static int vmk80xx_init_subdevices(struct comedi_device *dev) s->type = COMEDI_SUBD_COUNTER; s->subdev_flags = SDF_READABLE; s->n_chan = 2; - s->maxdata = boardinfo->cnt_maxdata; + s->maxdata = board->cnt_maxdata; s->insn_read= vmk80xx_cnt_insn_read; s->insn_config = vmk80xx_cnt_insn_config; if (devpriv->model == VMK8055_MODEL) { @@ -776,8 +776,8 @@ static int vmk80xx_init_subdevices(struct comedi_device *dev) s = &dev->subdevices[5]; s->type = COMEDI_SUBD_PWM; s->subdev_flags = SDF_READABLE | SDF_WRITABLE; - s->n_chan = boardinfo->pwm_nchans; - s->maxdata = boardinfo->pwm_maxdata; + s->n_chan = board->pwm_nchans; + s->maxdata = board->pwm_maxdata; s->insn_read= vmk80xx_pwm_insn_read; s->insn_write = vmk80xx_pwm_insn_write; } @@ -791,19 +791,22 @@ static int vmk80xx_auto_attach(struct comedi_device *dev, unsigned long context) { struct usb_interface *intf = comedi_to_usb_interface(dev); - const struct vmk80xx_board *boardinfo; + const struct vmk80xx_board *board = NULL; struct vmk80xx_private *devpriv; int ret; - boardinfo = &vmk80xx_boardinfo[context]; - dev->board_ptr = boardinfo; - dev->board_name = boardinfo->name; + if (context < ARRAY_SIZE(vmk80xx_boardinfo)) + board = &vmk80xx_boardinfo[context]; + if (!board) + return -ENODEV; + dev->board_ptr = board; + dev->board_name = board->name; devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv)); if (!devpriv) return -ENOMEM; - devpriv->model = boardinfo->model; + devpriv->model = board->model; ret = vmk80xx_find_usb_endpoints(dev); if (ret) -- 2.4.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 01/44] kernel: Add support for poweroff handler call chain
On 10/06/2014 10:28 PM, Guenter Roeck wrote: > Various drivers implement architecture and/or device specific means to > remove power from the system. For the most part, those drivers set the > global variable pm_power_off to point to a function within the driver. > > This mechanism has a number of drawbacks. Typically only one scheme > to remove power is supported (at least if pm_power_off is used). > At least in theory there can be multiple means remove power, some of > which may be less desirable. For example, some mechanisms may only > power off the CPU or the CPU card, while another may power off the > entire system. Others may really just execute a restart sequence > or drop into the ROM monitor. Using pm_power_off can also be racy > if the function pointer is set from a driver built as module, as the > driver may be in the process of being unloaded when pm_power_off is > called. If there are multiple poweroff handlers in the system, removing > a module with such a handler may inadvertently reset the pointer to > pm_power_off to NULL, leaving the system with no means to remove power. > > Introduce a system poweroff handler call chain to solve the described > problems. This call chain is expected to be executed from the > architecture specific machine_power_off() function. Drivers providing > system poweroff functionality are expected to register with this call chain. > By using the priority field in the notifier block, callers can control > poweroff handler execution sequence and thus ensure that the poweroff > handler with the optimal capabilities to remove power for a given system > is called first. What happened to this series? I want to add shutdown support to my platform and I need to write a register on the PMIC in one driver to configure it for shutdown instead of restart and then write an MMIO register to tell the PMIC to actually do the shutdown in another driver. It seems that the notifier solves this case for me, albeit with the slight complication that I need to order the two with some priority. I'm also considering putting the PMIC configuration part into the reboot notifier chain, because it only does things to change the configuration and not actually any shutdown/restart itself. That removes any requirement to get the priority of notifiers right. This series will still be useful for the MMIO register that needs to be toggled though. Right now I have to assign pm_power_off or hook the reboot notifier with a different priority to make this work. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH v3 1/6] hv: Modify vmbus to search for all MMIO ranges available
> -Original Message- > From: gre...@linuxfoundation.org [mailto:gre...@linuxfoundation.org] > Sent: Wednesday, June 17, 2015 12:11 PM > To: Jake Oshins > Cc: Vitaly Kuznetsov; KY Srinivasan; linux-ker...@vger.kernel.org; > de...@linuxdriverproject.org; o...@aepfle.de; a...@canonical.com; Haiyang > Zhang; Mike Ebersol > Subject: Re: [PATCH v3 1/6] hv: Modify vmbus to search for all MMIO ranges > available > > On Wed, Jun 17, 2015 at 05:41:58PM +, Jake Oshins wrote: > > > -Original Message- > > > From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] > > > Sent: Wednesday, June 17, 2015 10:28 AM > > > To: Jake Oshins > > > Cc: gre...@linuxfoundation.org; KY Srinivasan; linux- > > > ker...@vger.kernel.org; de...@linuxdriverproject.org; o...@aepfle.de; > > > a...@canonical.com; Haiyang Zhang; Mike Ebersol > > > Subject: Re: [PATCH v3 1/6] hv: Modify vmbus to search for all MMIO > ranges > > > available > > > > } > > > > > > > > @@ -1047,6 +1121,7 @@ static struct acpi_driver vmbus_acpi_driver = { > > > > .ids = vmbus_acpi_device_ids, > > > > .ops = { > > > > .add = vmbus_acpi_add, > > > > + .remove = vmbus_acpi_remove, > > > > > > This will probably need rebasing on top of current char-misc-next tree > > > as we already have commit e4ecb41c: "Drivers: hv: vmbus: introduce > > > vmbus_acpi_remove" there. > > > > > > > Thanks. Please educate me since I'm new around here. What should I > > do in response to this message? Wait for this tree to be pulled into > > the mainline and resend after rebasing? Something more proactive? > > It's KY's job to do this type of thing, he should handle this for you :) I have been on vacation for the last 10 days; currently waiting in the Dubai airport on the way back. I will work with Jake soon on this. K. Y > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] iio/accel: fixed 1 coding style problem
On Tue, Jun 16, 2015 at 04:09:34PM +0700, Tan Nguyen wrote: > Break line to fix "line over 80 characters" style problem. > > Signed-off-by: Tan Nguyen > --- > drivers/staging/iio/accel/adis16220_core.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Please use scripts/get_maintainer.pl to determine who to cc: and what mailing list to send patches to (hint, I'm not the iio maintainer...) thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/5] staging: wilc1000: remove the warnings on line over 80 characters.
On Wed, Jun 17, 2015 at 02:42:34PM +0900, Sunghoon Cho wrote: > This removes the warnings reported by checkpatch.pl for line over 80 > characters. > > Signed-off-by: Sunghoon Cho > --- > drivers/staging/wilc1000/wilc_wfi_netdevice.h | 7 --- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h > b/drivers/staging/wilc1000/wilc_wfi_netdevice.h > index 7f58551..96e4d5c 100644 > --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h > +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h > @@ -77,8 +77,8 @@ struct WILC_WFI_stats { > #define num_reg_frame 2 > /* > * If you use RX_BH_WORK_QUEUE on LPC3131: You may lose the first interrupt > on > - * LPC3131 which is important to get the MAC start status when you are > blocked inside > - * linux_wlan_firmware_download() which blocks mac_open(). > + * LPC3131 which is important to get the MAC start status when you are > blocked > + * inside linux_wlan_firmware_download() which blocks mac_open(). > */ > #if defined (NM73131_0_BOARD) > #define RX_BH_TYPE RX_BH_KTHREAD > @@ -150,7 +150,8 @@ struct WILC_WFI_priv { > u8 WILC_WFI_wep_default; > u8 WILC_WFI_wep_key[4][WLAN_KEY_LEN_WEP104]; > u8 WILC_WFI_wep_key_len[4]; > - struct net_device *real_ndev; /* The real interface that the monitor > is on */ > + /* The real interface that the monitor is on */ > + struct net_device *real_ndev; This change doesn't work well, I'd leave it as-is. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 0/7] staging: board: armadillo800eva: Board staging for sh_mobile_lcdc_fb
On Wed, Jun 17, 2015 at 10:38:49AM +0200, Geert Uytterhoeven wrote: > Hi Greg, Simon, Magnus, > > This patch series adds board staging support for the Renesas R-Mobile A1 > (r8a7740) based Armadillo-800 EVA board. It allows to support the frame > buffer device for the on-board LCD (which isn't supported by a DT-aware > driver yet) in modern DT-based multi-platform kernels. > > The board staging area was introduced last year to allow continuous > upstream in-tree development and integration of platform devices. It > helps developers integrate devices as platform devices for device > drivers that only provide platform device bindings. This in turn allows > for incremental development of both hardware feature support and DT > binding work in parallel. > > The goal is to complete the move to ARM multi-platform kernels for all > shmobile platforms, and drop the existing board files > (arch/arm/mach-shmobile/board-*). Once this series is accepted, more > than 3000 lines of legacy armadillo board code and r8a7740 SoC code can > be removed. > > This series consists of 5 parts: > - Patch 1 re-enables compilation of the board staging area, which was > disabled after a compile breakage, but has been fixed in the mean > time, > - Path 2 moves initialization of staging board code to an earlier > moment, as currently it happens after unused PM domains are powered > down, > - Patches 3 and 4 (hopefully) fix the existing kzm9d board staging > code, which was presumably "broken" by commit 9a1091ef0017c40a > ("irqchip: gic: Support hierarchy irq domain."), > - Patches 5 and 6 add support for registering platform devices with > complex dependencies (clocks and PM domains), and add armadillo > board staging code for enabling a frame buffer on the on-board LCD, > - Patch 7 (new) adds pinctrl and gpio-hog configuration to enable the > LCD. > > The first 6 patches should go in through the staging tree, the last one > through the shmobile tree. > > Major changes since v1 (more detailed changelogs in the individual > patches): > - Add support for low/high edge/level interrupts in hwirq translation, > - Move pinctrl and GPIO configuration from board staging code to DT, > - Use clk_add_alias() instead of open coding. > > Dependencies: > - This is against next-20150617, > - The gpio-hog in patch 7 depends on a bug fix like "[PATCH] [RFC] > gpio: Retry deferred GPIO hogging on pin range change" > (https://lkml.org/lkml/2015/6/16/455). It can be applied as-is > though. > > This was tested on r8a7740/armadillo. > This was not tested on emev2/kzm9d, due to lack of hardware. I have verified that kzm9d still boots with your patches applied on top of renesas-devel-20150617-v4.1-rc8. I used shmobile_defconfig and then enabled CONFIG_STAGING and in turn CONFIG_STAGING_BOARD. Let me know if you think further testing is appropriate. > Thanks for applying! > > Geert Uytterhoeven (7): > Revert "staging: board: disable as it breaks the build" > staging: board: Initialize staging board code earlier > staging: board: Add support for translating hwirq to virq numbers > staging: board: kzm9d: Translate hwirq numbers to virq numbers > staging: board: Add support for devices with complex dependencies > staging: board: armadillo800eva: Board staging for sh_mobile_lcdc_fb Feel free to add: Acked-by: Simon Horman to the above. > ARM: shmobile: armadillo800eva dts: Add pinctrl and gpio-hog for lcdc0 > > arch/arm/boot/dts/r8a7740-armadillo800eva.dts | 13 +++ > drivers/staging/board/Kconfig | 1 - > drivers/staging/board/Makefile| 3 +- > drivers/staging/board/armadillo800eva.c | 105 > drivers/staging/board/board.c | 136 > ++ > drivers/staging/board/board.h | 27 - > drivers/staging/board/kzm9d.c | 10 +- > 7 files changed, 290 insertions(+), 5 deletions(-) > create mode 100644 drivers/staging/board/armadillo800eva.c > > -- > 1.9.1 > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- > ge...@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like > that. > -- Linus Torvalds > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 4/5] staging: wilc1000: remove prohibited spaces.
On Wed, Jun 17, 2015 at 02:42:35PM +0900, Sunghoon Cho wrote: > This patch removes the warnings on the prohibited spaces between > function name and open parenthesis. > > Signed-off-by: Sunghoon Cho > --- > drivers/staging/wilc1000/wilc_wfi_netdevice.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h > b/drivers/staging/wilc1000/wilc_wfi_netdevice.h > index 96e4d5c..3307439 100644 > --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h > +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h > @@ -80,9 +80,9 @@ struct WILC_WFI_stats { > * LPC3131 which is important to get the MAC start status when you are > blocked > * inside linux_wlan_firmware_download() which blocks mac_open(). > */ > -#if defined (NM73131_0_BOARD) > +#if defined(NM73131_0_BOARD) > #define RX_BH_TYPE RX_BH_KTHREAD > -#elif defined (PANDA_BOARD) > +#elif defined(PANDA_BOARD) > #define RX_BH_TYPE RX_BH_THREADED_IRQ > #else > #define RX_BH_TYPE RX_BH_KTHREAD > -- > 1.9.1 Doesn't apply properly, please rebase and resend. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/5] staging: wilc1000: change commenting styles.
On Wed, Jun 17, 2015 at 04:28:51PM +0900, Sunghoon Cho wrote: > This patch changes commenting style to Linux preferred C89 style. > > Signed-off-by: Sunghoon Cho > --- > drivers/staging/wilc1000/wilc_wlan_if.h | 721 > ++-- > 1 file changed, 397 insertions(+), 324 deletions(-) > > diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h > b/drivers/staging/wilc1000/wilc_wlan_if.h > index ea0ec41..c7143cd 100644 > --- a/drivers/staging/wilc1000/wilc_wlan_if.h > +++ b/drivers/staging/wilc1000/wilc_wlan_if.h > @@ -1,17 +1,13 @@ > -/* > // */ > -/* */ > -/* Copyright (c) Atmel Corporation. All rights reserved. */ > -/* */ > -/* Module Name: wilc_wlan_if.h */ > -/* */ > -/* */ > -/* / > */ > +/* > + * Copyright (c) Atmel Corporation. All rights reserved. > + * Module Name: wilc_wlan_if.h > + */ > > > #ifndef WILC_WLAN_IF_H > #define WILC_WLAN_IF_H > > -/*bug 3887: [AP] Allow Management frames to be passed to the host*/ > +/* bug 3887: [AP] Allow Management frames to be passed to the host */ > #define WILC_AP_EXTERNAL_MLME > #define WILC_P2P > #define TCP_ENHANCEMENTS > @@ -24,11 +20,7 @@ > #include "linux_wlan_common.h" > > > -/ > - * > - * Debug Flags > - * > - / > +/* Debug Flags */ > > #define N_INIT 0x0001 > #define N_ERR0x0002 > @@ -36,31 +28,19 @@ > #define N_INTR 0x0008 > #define N_RXQ0x0010 > > -/ > - * > - * Host Interface Defines > - * > - / > +/* Host Interface Defines */ > > #define HIF_SDIO (0) > #define HIF_SPI(1 << 0) > #define HIF_SDIO_GPIO_IRQ (1 << 2) > > > -/ > - * > - * Tx/Rx Buffer Size Defines > - * > - / > +/* Tx/Rx Buffer Size Defines */ > > #define CE_TX_BUFFER_SIZE (64 * 1024) > #define CE_RX_BUFFER_SIZE (384 * 1024) > > -/ > - * > - * Wlan Interface Defines > - * > - / > +/* Wlan Interface Defines */ > > typedef struct { > uint32_t read_write: 1; > @@ -97,7 +77,7 @@ typedef struct { > void (*os_enter_cs)(void *); > void (*os_leave_cs)(void *); > > - /*Added by Amr - BugID_4720*/ > + /* Added by Amr - BugID_4720 */ > void (*os_spin_lock)(void *, unsigned long *); > void (*os_spin_unlock)(void *, unsigned long *); > > @@ -146,7 +126,7 @@ typedef struct { > uint32_t tx_buffer_size; > void *txq_critical_section; > > - /*Added by Amr - BugID_4720*/ > + /* Added by Amr - BugID_4720 */ > void *txq_add_to_head_critical_section; > void *txq_spin_lock; > > @@ -218,7 +198,7 @@ typedef struct { > int (*wlan_cfg_set)(int, uint32_t, uint8_t *, uint32_t, int, uint32_t); > int (*wlan_cfg_get)(int, uint32_t, int, uint32_t); > int (*wlan_cfg_get_value)(uint32_t, uint8_t *, uint32_t); > - /*Bug3959: transmitting mgmt frames received from host*/ > + /* Bug3959: transmitting mgmt frames received from host */ > #if defined(WILC_AP_EXTERNAL_MLME) || defined(WILC_P2P) > int (*wlan_add_mgmt_to_tx_que)(void *, uint8_t *, uint32_t, > wilc_tx_complete_func_t); > > @@ -229,11 +209,7 @@ typedef struct { > #endif > } wilc_wlan_oup_t; > > -/ > - * > - * Wlan Configuration ID > - * > - / > +/* Wlan Configuration ID */ > > #define MAX_SSID_LEN33 > #define MAX_RATES_SUPPORTED 12 > @@ -283,15 +259,15 @@ typedef enum { > } G_OPERATING_MODE_T; > > typedef enum { > - G_SHORT_PREAMBLE = 0, /* Short Preamble */ > - G_LONG_PREAMBLE = 1, /* Long Preamble */ > - G_AUTO_PREAMBLE = 2, /* Auto Preamble Selection */ > + G_SHORT_PREAMBLE = 0, /* Short Preamble */ > + G_LONG_PREAMBLE = 1, /* Long Preamble */ > + G_AUTO_PREAMBLE = 2, /* Auto Preamble Selection */ > } G_PREAMBLE_T; > > #define MAC_CONNECTED1 > #define MAC_DISCONNECTED 0 > > -/*bug3819: */ > +/* bug3819: */ > #define SCAN_DONETRUE > typedef enum { > PASSIVE_SCAN = 0, > @@ -328,10 +304,10 @@ typedef enum { > WEP_104 = 0x7, > WPA_AES = 0x29, > WPA_TKIP = 0x49, > - WPA_AES_TKIP = 0x69,/* Aes or Tkip */ > + WPA_AES_TKIP = 0x69,/* Aes or Tkip */ You are changing the indentation, not // into /* style here. You do this in other places, just changing alignment, not the C99 comment style. Please fix up into
Re: [PATCH 2/5] staging: wilc1000: remove the warnings on multiple blank line uses.
On Wed, Jun 17, 2015 at 04:28:52PM +0900, Sunghoon Cho wrote: > This patch removes the warnings reported by checkpatch.pl regarding > the multiple blank line. > > Signed-off-by: Sunghoon Cho > --- > drivers/staging/wilc1000/wilc_wlan_if.h | 12 > 1 file changed, 12 deletions(-) Doesn't apply :( Please rebase all of these and resend. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: wlan-ng: remove unused debug macro
On Tue, Jun 16, 2015 at 05:09:35AM +, Gujulan Elango, Hari Prasath (H.) wrote: > On Mon, Jun 15, 2015 at 09:55:15PM -0700, gre...@linuxfoundation.org wrote: > > On Mon, Jun 15, 2015 at 11:44:24AM +, Gujulan Elango, Hari Prasath (H.) > > wrote: > > > From: Hari Prasath Gujulan Elango > > > > > > Thi patch removes ununsed debug macro and its references in this > > > file.The macro is used around pr_debug which itself can be dynamically > > > enabled/disabled. > > > > > > Signed-off-by: Hari Prasath Gujulan Elango > > > --- > > > drivers/staging/wlan-ng/p80211wep.c | 7 --- > > > 1 file changed, 7 deletions(-) > > > > > > diff --git a/drivers/staging/wlan-ng/p80211wep.c > > > b/drivers/staging/wlan-ng/p80211wep.c > > > index c4fabad..f1afd0e 100644 > > > --- a/drivers/staging/wlan-ng/p80211wep.c > > > +++ b/drivers/staging/wlan-ng/p80211wep.c > > > @@ -53,7 +53,6 @@ > > > #include > > > #include > > > > > > -/* #define WEP_DEBUG */ > > > > > > #include "p80211hdr.h" > > > #include "p80211types.h" > > > @@ -133,10 +132,8 @@ int wep_change_key(wlandevice_t *wlandev, int > > > keynum, u8 *key, int keylen) > > > if (keynum >= NUM_WEPKEYS) > > > return -1; > > > > > > -#ifdef WEP_DEBUG > > > pr_debug("WEP key %d len %d = %*phC\n", keynum, keylen, > > > 8, key); > > > -#endif > > > > You just added this to the driver now, not what you were saying you were > > doing :( > > Greg,if my understanding is correct,do you mean to say that by > removing the MACRO WEP_DEBUG which is not defined,this patch adds the > dynamic debug statements in the driver? Yes. > As we know that pr_debug is > something that can be dynamically enable/disable during runtime,then > why to have a MACRO which can enable/disable statically ?Please > correct me I am wrong. Why not just delete these as obviously they are not being used? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 0/9] fix sm7xxfb
On Wed, Jun 17, 2015 at 04:54:39PM +0530, Sudip Mukherjee wrote: > fixing the few remaining issues of sm7xxfb before sending the patch to > remove it from staging. > Also attempted to setup a tree and all the patches of this series are > available there for you. > > > The following changes since commit f0feeaff9c60bfb3dbadf09da15d70cf35700f29: > > staging: wilc1000: remove unwanted code (2015-06-16 19:23:25 -0700) > > are available in the git repository at: > > git://git.vectorindia.net/staging staging-testing Sorry, I don't take git pulls for staging patches. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 0/9] fix sm7xxfb
On Wed, Jun 17, 2015 at 09:43:51PM -0700, Greg Kroah-Hartman wrote: > On Wed, Jun 17, 2015 at 04:54:39PM +0530, Sudip Mukherjee wrote: > > fixing the few remaining issues of sm7xxfb before sending the patch to > > remove it from staging. Oh, the BIG_ENDIAN defines need to be fixed up, surely that can be done in a more "correct" way. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH V2] staging: wilc1000: remove commented code
Remove the commented codes using #if 0. Signed-off-by: Chaehyun Lim --- V2: revert commented code using typedef and rebase latest staging-testing. drivers/staging/wilc1000/coreconfigurator.c | 30 --- drivers/staging/wilc1000/coreconfigurator.h | 300 -- drivers/staging/wilc1000/host_interface.c | 76 --- drivers/staging/wilc1000/host_interface.h | 65 +- drivers/staging/wilc1000/linux_mon.c | 45 drivers/staging/wilc1000/linux_wlan.c | 22 -- drivers/staging/wilc1000/wilc_sdio.c | 44 drivers/staging/wilc1000/wilc_spi.c | 70 +- drivers/staging/wilc1000/wilc_wfi_netdevice.c | 9 - drivers/staging/wilc1000/wilc_wlan.c | 31 --- drivers/staging/wilc1000/wilc_wlan_cfg.c | 26 --- drivers/staging/wilc1000/wilc_wlan_if.h | 22 -- 12 files changed, 2 insertions(+), 738 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 523c863..ed6ac45 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -210,9 +210,6 @@ static tstrWID gastrWIDs[] = { {WID_REKEY_POLICY, WID_CHAR}, {WID_REKEY_PERIOD, WID_INT}, {WID_REKEY_PACKET_COUNT,WID_INT}, -#if 0 - {WID_WEP_KEY_VALUE0,WID_STR}, -#endif {WID_11I_PSK, WID_STR}, {WID_1X_KEY,WID_STR}, {WID_1X_SERV_ADDR, WID_IP}, @@ -1619,26 +1616,6 @@ s32 further_process_response(u8 *resp, break; case WID_BIN_DATA: - #if 0 - /* FILE*fp_bin = NULL; */ - u8 first_bin_wid = 1; - if (first_bin_wid) { - /* fp_bin = fopen("wid_response.bin","wb"); */ - first_bin_wid = 0; - } else { - /* fp_bin = fopen("wid_response.bin","ab"); */ - } - - if (/*fp_bin == NULL*/ 0) { - PRINT_ER("Error: Could not open wid_response.bin for write\n"); - return -2; - } - - /* fwrite(resp + idx, cfg_len, 1, fp_bin); */ - - /* fclose(fp_bin); */ - #endif - if (pstrWIDresult->s32ValueSize >= cfg_len) { WILC_memcpy(pstrWIDresult->ps8WidVal, resp + idx, cfg_len); pstrWIDresult->s32ValueSize = cfg_len; @@ -1884,13 +1861,6 @@ s32 CreateConfigPacket(s8 *ps8packet, s32 *ps32PacketLength, pstrWIDs[u32idx].ps8WidVal, pstrWIDs[u32idx].s32ValueSize); break; - #if 0 - case WID_ADR: - ProcessAdrWid(ps8packet, ps32PacketLength, &pstrWIDs[u32idx], - pstrWIDs[u32idx].ps8WidVal); - break; - - #endif case WID_IP: ProcessIPwid(ps8packet, ps32PacketLength, &pstrWIDs[u32idx], pstrWIDs[u32idx].ps8WidVal); diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index 3ca067e..9059c8d 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -71,306 +71,6 @@ extern u16 g_num_total_switches; /*/ /* Type Definitions */ /*/ -/* WID Data Types */ -#if 0 -typedef enum { - WID_CHAR = 0, - WID_SHORT = 1, - WID_INT = 2, - WID_STR = 3, - WID_ADR = 4, - WID_BIN = 5, - WID_IP= 6, - WID_UNDEF = 7, - WID_TYPE_FORCE_32BIT = 0x -} tenuWIDtype; - -/* WLAN Identifiers */ -typedef enum { - WID_NIL= -1, - /* EMAC Character WID list */ - WID_BSS_TYPE = 0x, - WID_CURRENT_TX_RATE= 0x0001, - WID_CURRENT_CHANNEL= 0x0002, - WID_PREAMBLE = 0x0003, - WID_11G_OPERATING_MODE = 0x0004, - WID_STATUS = 0x0005, - WID_11G_PROT_MECH = 0x0006, - WID_SCAN_TYPE = 0x0007, - WID_PRIVACY_INVOKED= 0x0008, - WID_KEY_ID = 0x0009, - WID_QOS_ENABLE = 0x000A, - WID_POWER_MANAGEMENT = 0x000B, - WID_11I_MODE = 0x000C, - WID_AUTH_TYPE = 0x000D, -
Re: [PATCH] staging: wlan-ng: remove unused debug macro
On Wed, Jun 17, 2015 at 09:40:42PM -0700, gre...@linuxfoundation.org wrote: > On Tue, Jun 16, 2015 at 05:09:35AM +, Gujulan Elango, Hari Prasath (H.) > wrote: > > On Mon, Jun 15, 2015 at 09:55:15PM -0700, gre...@linuxfoundation.org wrote: > > > On Mon, Jun 15, 2015 at 11:44:24AM +, Gujulan Elango, Hari Prasath > > > (H.) wrote: > > > > From: Hari Prasath Gujulan Elango > > > > > > > > Thi patch removes ununsed debug macro and its references in this > > > > file.The macro is used around pr_debug which itself can be dynamically > > > > enabled/disabled. > > > > > > > > Signed-off-by: Hari Prasath Gujulan Elango > > > > --- > > > > drivers/staging/wlan-ng/p80211wep.c | 7 --- > > > > 1 file changed, 7 deletions(-) > > > > > > > > diff --git a/drivers/staging/wlan-ng/p80211wep.c > > > > b/drivers/staging/wlan-ng/p80211wep.c > > > > index c4fabad..f1afd0e 100644 > > > > --- a/drivers/staging/wlan-ng/p80211wep.c > > > > +++ b/drivers/staging/wlan-ng/p80211wep.c > > > > @@ -53,7 +53,6 @@ > > > > #include > > > > #include > > > > > > > > -/* #define WEP_DEBUG */ > > > > > > > > #include "p80211hdr.h" > > > > #include "p80211types.h" > > > > @@ -133,10 +132,8 @@ int wep_change_key(wlandevice_t *wlandev, int > > > > keynum, u8 *key, int keylen) > > > > if (keynum >= NUM_WEPKEYS) > > > > return -1; > > > > > > > > -#ifdef WEP_DEBUG > > > > pr_debug("WEP key %d len %d = %*phC\n", keynum, keylen, > > > > 8, key); > > > > -#endif > > > > > > You just added this to the driver now, not what you were saying you were > > > doing :( > > > > Greg,if my understanding is correct,do you mean to say that by > > removing the MACRO WEP_DEBUG which is not defined,this patch adds the > > dynamic debug statements in the driver? > > Yes. > > > As we know that pr_debug is > > something that can be dynamically enable/disable during runtime,then > > why to have a MACRO which can enable/disable statically ?Please > > correct me I am wrong. > > Why not just delete these as obviously they are not being used? > > thanks, > > greg k-h Thanks Greg.Yes I will remove the macro as well as the debug prints which aren't used and resend v2. Regards Hari Prasath ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: wlan-ng: remove unused debug macro
On Wed, Jun 17, 2015 at 09:40:42PM -0700, gre...@linuxfoundation.org wrote: > On Tue, Jun 16, 2015 at 05:09:35AM +, Gujulan Elango, Hari Prasath (H.) > wrote: > > On Mon, Jun 15, 2015 at 09:55:15PM -0700, gre...@linuxfoundation.org wrote: > > > On Mon, Jun 15, 2015 at 11:44:24AM +, Gujulan Elango, Hari Prasath > > > (H.) wrote: > > > > From: Hari Prasath Gujulan Elango > > > > > > > > Thi patch removes ununsed debug macro and its references in this > > > > file.The macro is used around pr_debug which itself can be dynamically > > > > enabled/disabled. > > > > > > > > Signed-off-by: Hari Prasath Gujulan Elango > > > > --- > > > > drivers/staging/wlan-ng/p80211wep.c | 7 --- > > > > 1 file changed, 7 deletions(-) > > > > > > > > diff --git a/drivers/staging/wlan-ng/p80211wep.c > > > > b/drivers/staging/wlan-ng/p80211wep.c > > > > index c4fabad..f1afd0e 100644 > > > > --- a/drivers/staging/wlan-ng/p80211wep.c > > > > +++ b/drivers/staging/wlan-ng/p80211wep.c > > > > @@ -53,7 +53,6 @@ > > > > #include > > > > #include > > > > > > > > -/* #define WEP_DEBUG */ > > > > > > > > #include "p80211hdr.h" > > > > #include "p80211types.h" > > > > @@ -133,10 +132,8 @@ int wep_change_key(wlandevice_t *wlandev, int > > > > keynum, u8 *key, int keylen) > > > > if (keynum >= NUM_WEPKEYS) > > > > return -1; > > > > > > > > -#ifdef WEP_DEBUG > > > > pr_debug("WEP key %d len %d = %*phC\n", keynum, keylen, > > > > 8, key); > > > > -#endif > > > > > > You just added this to the driver now, not what you were saying you were > > > doing :( > > > > Greg,if my understanding is correct,do you mean to say that by > > removing the MACRO WEP_DEBUG which is not defined,this patch adds the > > dynamic debug statements in the driver? > > Yes. > > > As we know that pr_debug is > > something that can be dynamically enable/disable during runtime,then > > why to have a MACRO which can enable/disable statically ?Please > > correct me I am wrong. > > Why not just delete these as obviously they are not being used? > > thanks, > > greg k-h Sorry I will send a new patch as title differs.Please drop this one. Thanks & Regards, Hari Prasath ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: wlan-ng: Remove ununsed debug print & associated macro
From: Hari Prasath Gujulan Elango This patch removed a undefined macro and debug prints associated with it. Signed-off-by: Hari Prasath Gujulan Elango --- drivers/staging/wlan-ng/p80211wep.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/drivers/staging/wlan-ng/p80211wep.c b/drivers/staging/wlan-ng/p80211wep.c index c4fabad..c363456 100644 --- a/drivers/staging/wlan-ng/p80211wep.c +++ b/drivers/staging/wlan-ng/p80211wep.c @@ -53,7 +53,6 @@ #include #include -/* #define WEP_DEBUG */ #include "p80211hdr.h" #include "p80211types.h" @@ -133,10 +132,6 @@ int wep_change_key(wlandevice_t *wlandev, int keynum, u8 *key, int keylen) if (keynum >= NUM_WEPKEYS) return -1; -#ifdef WEP_DEBUG - pr_debug("WEP key %d len %d = %*phC\n", keynum, keylen, - 8, key); -#endif wlandev->wep_keylens[keynum] = keylen; memcpy(wlandev->wep_keys[keynum], key, keylen); @@ -181,10 +176,6 @@ int wep_decrypt(wlandevice_t *wlandev, u8 *buf, u32 len, int key_override, keylen += 3;/* add in IV bytes */ -#ifdef WEP_DEBUG - pr_debug("D %d: %*ph (%d %d) %*phC\n", len, 3, key, - keyidx, keylen, 5, key + 3); -#endif /* set up the RC4 state */ for (i = 0; i < 256; i++) @@ -258,11 +249,6 @@ int wep_encrypt(wlandevice_t *wlandev, u8 *buf, u8 *dst, u32 len, int keynum, keylen += 3;/* add in IV bytes */ -#ifdef WEP_DEBUG - pr_debug("E %d (%d/%d %d) %*ph %*phC\n", len, - iv[3], keynum, keylen, 3, key, 5, key + 3); -#endif - /* set up the RC4 state */ for (i = 0; i < 256; i++) s[i] = i; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: kill unused hal_data_8188e::fw_ractrl flag
Flag is never set. Remove it and the code that is dead because of it. Signed-off-by: Jakub Sitnicki --- drivers/staging/rtl8188eu/hal/odm.c | 11 -- drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c | 21 -- drivers/staging/rtl8188eu/hal/usb_halinit.c | 27 ++-- drivers/staging/rtl8188eu/include/rtl8188e_cmd.h | 1 - drivers/staging/rtl8188eu/include/rtl8188e_hal.h | 1 - drivers/staging/rtl8188eu/include/sta_info.h | 1 - 6 files changed, 6 insertions(+), 56 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/odm.c b/drivers/staging/rtl8188eu/hal/odm.c index 28b5e7b..710fdc3 100644 --- a/drivers/staging/rtl8188eu/hal/odm.c +++ b/drivers/staging/rtl8188eu/hal/odm.c @@ -1170,13 +1170,10 @@ void odm_RSSIMonitorCheckCE(struct odm_dm_struct *pDM_Odm) } for (i = 0; i < sta_cnt; i++) { - if (PWDB_rssi[i] != (0)) { - if (pHalData->fw_ractrl) { - /* Report every sta's RSSI to FW */ - } else { - ODM_RA_SetRSSI_8188E( - &(pHalData->odmpriv), (PWDB_rssi[i]&0xFF), (u8)((PWDB_rssi[i]>>16) & 0xFF)); - } + if (PWDB_rssi[i] != 0) { + ODM_RA_SetRSSI_8188E(&pHalData->odmpriv, +PWDB_rssi[i] & 0xFF, +(PWDB_rssi[i] >> 16) & 0xFF); } } diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c b/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c index 86347f2..0a62bfa 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c @@ -127,27 +127,6 @@ exit: return ret; } -u8 rtl8188e_set_raid_cmd(struct adapter *adapt, u32 mask) -{ - u8 buf[3]; - u8 res = _SUCCESS; - struct hal_data_8188e *haldata = GET_HAL_DATA(adapt); - - if (haldata->fw_ractrl) { - - memset(buf, 0, 3); - put_unaligned_le32(mask, buf); - - FillH2CCmd_88E(adapt, H2C_DM_MACID_CFG, 3, buf); - } else { - DBG_88E("==>%s fw dont support RA\n", __func__); - res = _FAIL; - } - - - return res; -} - /* bitmap[0:27] = tx_rate_bitmap */ /* bitmap[28:31]= Rate Adaptive id */ /* arg[0:4] = macid */ diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b/drivers/staging/rtl8188eu/hal/usb_halinit.c index 7b01d5a..caf3731 100644 --- a/drivers/staging/rtl8188eu/hal/usb_halinit.c +++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c @@ -743,19 +743,16 @@ static u32 rtl8188eu_hal_init(struct adapter *Adapter) if (Adapter->registrypriv.mp_mode == 1) { _InitRxSetting(Adapter); Adapter->bFWReady = false; - haldata->fw_ractrl = false; } else { status = rtl88eu_download_fw(Adapter); if (status) { DBG_88E("%s: Download Firmware failed!!\n", __func__); Adapter->bFWReady = false; - haldata->fw_ractrl = false; return status; } else { RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("Initializeadapt8192CSdio(): Download Firmware Success!!\n")); Adapter->bFWReady = true; - haldata->fw_ractrl = false; } } rtl8188e_InitializeFirmwareVars(Adapter); @@ -2086,28 +2083,9 @@ static void UpdateHalRAMask8188EUsb(struct adapter *adapt, u32 mac_id, u8 rssi_l init_rate = get_highest_rate_idx(mask)&0x3f; - if (haldata->fw_ractrl) { - u8 arg; + ODM_RA_UpdateRateInfo_8188E(&haldata->odmpriv, mac_id, + raid, mask, shortGIrate); - arg = mac_id & 0x1f;/* MACID */ - arg |= BIT(7); - if (shortGIrate) - arg |= BIT(5); - mask |= ((raid << 28) & 0xf000); - DBG_88E("update raid entry, mask=0x%x, arg=0x%x\n", mask, arg); - psta->ra_mask = mask; - mask |= ((raid << 28) & 0xf000); - - /* to do ,for 8188E-SMIC */ - rtl8188e_set_raid_cmd(adapt, mask); - } else { - ODM_RA_UpdateRateInfo_8188E(&(haldata->odmpriv), - mac_id, - raid, - mask, - shortGIrate - ); - } /* set ra_id */ psta->raid = raid; psta->init_rate = init_rate; @@ -2157,7 +2135,6 @@ static void rtl8188eu_init_default_value(struct adapter *adapt) pwrctrlpriv = &adapt->pwrctrlpriv; /* init default value */ - haldata->fw_ractrl = false;
Re: [PATCH 01/44] kernel: Add support for poweroff handler call chain
On Thu, Jun 18, 2015 at 3:04 AM, Stephen Boyd wrote: > On 10/06/2014 10:28 PM, Guenter Roeck wrote: >> Various drivers implement architecture and/or device specific means to >> remove power from the system. For the most part, those drivers set the >> global variable pm_power_off to point to a function within the driver. >> >> This mechanism has a number of drawbacks. Typically only one scheme >> to remove power is supported (at least if pm_power_off is used). >> At least in theory there can be multiple means remove power, some of >> which may be less desirable. For example, some mechanisms may only >> power off the CPU or the CPU card, while another may power off the >> entire system. Others may really just execute a restart sequence >> or drop into the ROM monitor. Using pm_power_off can also be racy >> if the function pointer is set from a driver built as module, as the >> driver may be in the process of being unloaded when pm_power_off is >> called. If there are multiple poweroff handlers in the system, removing >> a module with such a handler may inadvertently reset the pointer to >> pm_power_off to NULL, leaving the system with no means to remove power. >> >> Introduce a system poweroff handler call chain to solve the described >> problems. This call chain is expected to be executed from the >> architecture specific machine_power_off() function. Drivers providing >> system poweroff functionality are expected to register with this call chain. >> By using the priority field in the notifier block, callers can control >> poweroff handler execution sequence and thus ensure that the poweroff >> handler with the optimal capabilities to remove power for a given system >> is called first. > > What happened to this series? I want to add shutdown support to my > platform and I need to write a register on the PMIC in one driver to > configure it for shutdown instead of restart and then write an MMIO > register to tell the PMIC to actually do the shutdown in another driver. > It seems that the notifier solves this case for me, albeit with the > slight complication that I need to order the two with some priority. I was wondering the same thing. I did find out that things kind of stalled after Linus cast doubt on the chosen path [1]. I'm not sure there's any consensus on what would be best to do instead. Frans [1] https://lkml.org/lkml/2014/11/6/641 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel