diff --git a/arch/arc/soc/quark_se_ss/Kconfig.defconfig b/arch/arc/soc/quark_se_ss/Kconfig.defconfig index 9ba8a7142e..4b4cc6d6a7 100644 --- a/arch/arc/soc/quark_se_ss/Kconfig.defconfig +++ b/arch/arc/soc/quark_se_ss/Kconfig.defconfig @@ -105,32 +105,30 @@ if I2C config I2C_QUARK_SE_SS def_bool y -if I2C_QUARK_SE_SS - -config I2C_QUARK_SE_SS_0 +config I2C_0 def_bool y -if I2C_QUARK_SE_SS_0 - -config I2C_QUARK_SE_SS_0_NAME +config I2C_0_NAME default "I2C_0" -config I2C_QUARK_SE_SS_0_DEFAULT_CFG +config I2C_0_DEFAULT_CFG default 0x12 -endif # I2C_QUARK_SE_SS_0 +config I2C_0_IRQ_PRI + default 2 -if I2C_QUARK_SE_SS_1 +if I2C_1 -config I2C_QUARK_SE_SS_1_NAME +config I2C_1_NAME default "I2C_1" -config I2C_QUARK_SE_SS_1_DEFAULT_CFG +config I2C_1_DEFAULT_CFG default 0x12 -endif # I2C_QUARK_SE_SS_1 +config I2C_1_IRQ_PRI + default 2 -endif # I2C_QUARK_SE_SS +endif # I2C_1 endif # I2C diff --git a/arch/arm/soc/atmel_sam3/Kconfig.defconfig b/arch/arm/soc/atmel_sam3/Kconfig.defconfig index 0465a015d3..de9d486ceb 100644 --- a/arch/arm/soc/atmel_sam3/Kconfig.defconfig +++ b/arch/arm/soc/atmel_sam3/Kconfig.defconfig @@ -99,11 +99,16 @@ if I2C config I2C_ATMEL_SAM3 def_bool y -config I2C_ATMEL_SAM3_0 +config I2C_0 + default y +config I2C_0_IRQ_PRI + default 0 + +config I2C_1 default y -config I2C_ATMEL_SAM3_1 - default y +config I2C_1_IRQ_PRI + default 0 endif # I2C diff --git a/arch/x86/soc/quark_d2000/Kconfig.defconfig b/arch/x86/soc/quark_d2000/Kconfig.defconfig index fc178c26d0..03dfe36b8e 100644 --- a/arch/x86/soc/quark_d2000/Kconfig.defconfig +++ b/arch/x86/soc/quark_d2000/Kconfig.defconfig @@ -124,11 +124,11 @@ config I2C_QMSI def_bool y if I2C_QMSI -config I2C_QMSI_0 +config I2C_0 def_bool y -config I2C_QMSI_0_IRQ_PRI +config I2C_0_IRQ_PRI default 0 -config I2C_QMSI_0_DEFAULT_CFG +config I2C_0_DEFAULT_CFG default 0x12 endif # I2C_QMSI endif # I2C diff --git a/arch/x86/soc/quark_se/Kconfig.defconfig b/arch/x86/soc/quark_se/Kconfig.defconfig index d3bb534ca9..2d03205913 100644 --- a/arch/x86/soc/quark_se/Kconfig.defconfig +++ b/arch/x86/soc/quark_se/Kconfig.defconfig @@ -76,28 +76,28 @@ if I2C config I2C_QMSI def_bool y -config I2C_QMSI_0 +config I2C_0 def_bool y -if I2C_QMSI_0 +if I2C_0 -config I2C_QMSI_0_IRQ_PRI +config I2C_0_IRQ_PRI default 2 -config I2C_QMSI_0_DEFAULT_CFG +config I2C_0_DEFAULT_CFG default 0x12 -endif # I2C_QMSI_0 +endif # I2C_0 -config I2C_QMSI_1 +config I2C_1 def_bool y -if I2C_QMSI_1 -config I2C_QMSI_1_IRQ_PRI +if I2C_1 +config I2C_1_IRQ_PRI default 2 -config I2C_QMSI_1_DEFAULT_CFG +config I2C_1_DEFAULT_CFG default 0x12 -endif # I2C_QMSI_1 +endif # I2C_1 endif # I2C diff --git a/arch/x86/soc/quark_x1000/Kconfig.defconfig b/arch/x86/soc/quark_x1000/Kconfig.defconfig index e3b2636582..a1cd7c1e47 100644 --- a/arch/x86/soc/quark_x1000/Kconfig.defconfig +++ b/arch/x86/soc/quark_x1000/Kconfig.defconfig @@ -81,21 +81,21 @@ config I2C_DW if I2C_DW -config I2C_DW_0 +config I2C_0 def_bool y -if I2C_DW_0 +if I2C_0 -config I2C_DW_0_NAME +config I2C_0_NAME default "I2C_0" -config I2C_DW_0_DEFAULT_CFG +config I2C_0_DEFAULT_CFG default 0x12 -config I2C_DW_0_IRQ_PRI +config I2C_0_IRQ_PRI default 2 -config I2C_DW_0_IRQ_SHARED_NAME +config I2C_0_IRQ_SHARED_NAME default SHARED_IRQ_0_NAME if SHARED_IRQ -endif # I2C_DW_0 +endif # I2C_0 endif # I2C_DW diff --git a/boards/galileo/Kconfig.defconfig b/boards/galileo/Kconfig.defconfig index 76bae30de8..5421c56524 100644 --- a/boards/galileo/Kconfig.defconfig +++ b/boards/galileo/Kconfig.defconfig @@ -82,7 +82,7 @@ config GPIO_PCAL9535A_0_DEV_NAME config GPIO_PCAL9535A_0_I2C_ADDR default 0x25 config GPIO_PCAL9535A_0_I2C_MASTER_DEV_NAME - default I2C_DW_0_NAME + default I2C_0_NAME endif # GPIO_PCAL9535A_0 @@ -96,7 +96,7 @@ config GPIO_PCAL9535A_1_DEV_NAME config GPIO_PCAL9535A_1_I2C_ADDR default 0x26 config GPIO_PCAL9535A_1_I2C_MASTER_DEV_NAME - default I2C_DW_0_NAME + default I2C_0_NAME endif # GPIO_PCAL9535A_1 @@ -110,7 +110,7 @@ config GPIO_PCAL9535A_2_DEV_NAME config GPIO_PCAL9535A_2_I2C_ADDR default 0x27 config GPIO_PCAL9535A_2_I2C_MASTER_DEV_NAME - default I2C_DW_0_NAME + default I2C_0_NAME endif # GPIO_PCAL9535A_2 @@ -135,7 +135,7 @@ config PWM_PCA9685_0_DEV_NAME config PWM_PCA9685_0_I2C_ADDR default 0x47 config PWM_PCA9685_0_I2C_MASTER_DEV_NAME - default I2C_DW_0_NAME + default I2C_0_NAME endif # PWM_PCA9685_0 endif # PWM_PCA9685 diff --git a/boards/galileo/galileo_defconfig b/boards/galileo/galileo_defconfig index e6162bf475..bd091e4c72 100644 --- a/boards/galileo/galileo_defconfig +++ b/boards/galileo/galileo_defconfig @@ -15,8 +15,8 @@ CONFIG_GPIO=y CONFIG_GPIO_DW_0_IRQ_SHARED=y CONFIG_I2C=y CONFIG_I2C_DW=y -CONFIG_I2C_DW_0=y -CONFIG_I2C_DW_0_IRQ_SHARED=y +CONFIG_I2C_0=y +CONFIG_I2C_0_IRQ_SHARED=y CONFIG_GPIO_PCAL9535A=y CONFIG_GPIO_SCH=y CONFIG_GPIO_SCH_0=y diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig index f40e4953d2..fcd5199664 100644 --- a/drivers/i2c/Kconfig +++ b/drivers/i2c/Kconfig @@ -26,6 +26,44 @@ menuconfig I2C help Enable I2C Driver Configuration +if I2C + +config I2C_DW + bool "Design Ware I2C support" + depends on I2C + default n + help + Enable Design Ware I2C support on the selected platform + +config I2C_QUARK_SE_SS + bool "I2C Driver for Quark SE Sensor Subsystem (SS)" + default n + depends on I2C + help + This option enables the driver to support the I2C on Quark SE Sensor + Subsystem. + + +config I2C_QMSI + bool "QMSI I2C driver" + depends on I2C && QMSI + default n + help + This option enable the QMSI I2C driver. + + This driver is simply a shim driver based on the I2C driver + provided by the QMSI BSP. + +config I2C_ATMEL_SAM3 + bool "Atmel SAM3 I2C Driver" + depends on I2C && SOC_ATMEL_SAM3 + default n + help + Enable I2C support on the Atmel SAM3 family processor. + + Says y to enable additional options to enable support + for individual controllers. + config I2C_INIT_PRIORITY int depends on I2C @@ -46,10 +84,92 @@ config I2C_DEBUG help This option enables the debug features for I2C connections -source "drivers/i2c/Kconfig.dw" -source "drivers/i2c/Kconfig.quark_se_ss" +config I2C_SHARED_IRQ + bool + default n + depends on I2C -source "drivers/i2c/Kconfig.qmsi" +choice + prompt "I2C_0 Interrupts via" + default I2C_0_IRQ_DIRECT + depends on I2C_0 -source "drivers/i2c/Kconfig.atmel_sam3" +config I2C_0_IRQ_DIRECT + bool "Direct Hardware Interrupt" + help + When interrupts fire, the driver's ISR function is being called directly. + +config I2C_0_IRQ_SHARED + bool "Shared IRQ" + depends on SHARED_IRQ + select I2C_SHARED_IRQ + help + When interrupts fire, the shared IRQ driver is notified. Then the shared IRQ + driver dispatches the interrupt to other drivers. + +endchoice + +config I2C_0_IRQ_SHARED_NAME + string "Device name for Shared IRQ" + depends on I2C_0 && I2C_0_IRQ_SHARED + help + Specify the device name for the shared IRQ driver. It is used to register + this driver with the shared IRQ driver, so interrupts can be dispatched + correctly. + +config I2C_0 + bool "Enable I2C_0" + depends on I2C + default n + +config I2C_0_NAME + string "Select a name for finding the device" + depends on I2C_0 + default "I2C_0" + +config I2C_0_DEFAULT_CFG + hex "I2C default configuration" + depends on I2C_0 + default 0x0 + help + Allows the I2C port to be brought up with a default configuration. + This is useful to set if other drivers depend upon using the I2C bus + before the application has a chance to custom configure the port. + Setting this value does not prohibit the application from customizing + the values later. Refer to the I2C datasheet for proper values. + +config I2C_0_IRQ_PRI + int "Controller interrupt priority" + depends on I2C_0 && I2C_0_IRQ_DIRECT + help + IRQ priority. + +config I2C_1 + bool "Enable I2C Port 1" + depends on I2C + default n + +config I2C_1_NAME + string "Select a name for finding the device" + default "I2C_1" + depends on I2C_1 + +config I2C_1_DEFAULT_CFG + hex "I2C default configuration" + depends on I2C_1 + default 0x0 + help + Allows the I2C port to be brought up with a default configuration. + This is useful to set if other drivers depend upon using the I2C bus + before the application has a chance to custom configure the port. + Setting this value does not prohibit the application from customizing + the values later. Refer to the I2C datasheet for proper values. + +config I2C_1_IRQ_PRI + int "Controller interrupt priority" + depends on I2C_1 && I2C_0_IRQ_DIRECT + help + IRQ priority. + +endif diff --git a/drivers/i2c/Kconfig.atmel_sam3 b/drivers/i2c/Kconfig.atmel_sam3 deleted file mode 100644 index fda64ee720..0000000000 --- a/drivers/i2c/Kconfig.atmel_sam3 +++ /dev/null @@ -1,111 +0,0 @@ -# Kconfig.atmel_sam3 - Atmel SAM3 I2C configuration options -# -# -# Copyright (c) 2016 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -menuconfig I2C_ATMEL_SAM3 - bool "Atmel SAM3 I2C Driver" - depends on I2C && SOC_ATMEL_SAM3 - default n - help - Enable I2C support on the Atmel SAM3 family processor. - - Says y to enable additional options to enable support - for individual controllers. - -if I2C_ATMEL_SAM3 - -config I2C_ATMEL_SAM3_0 - bool "Atmel SAM3 I2C Controller 0 (TWI0)" - depends on I2C_ATMEL_SAM3 - default n - help - Build driver for thw I2C Controller #0 (TWI0). - - Says y if you intend to use the TWI0. - -config I2C_ATMEL_SAM3_0_NAME - string "Device name for Atmel SAM3 I2C Controller 0" - depends on I2C_ATMEL_SAM3_0 - default "I2C_0" - help - The device name for Atmel SAM3 I2C Controller 0. - - Default is "I2C_0". - -config I2C_ATMEL_SAM3_0_IRQ_PRI - int "IRQ Priority for Atmel SAM3 I2C Controller 0" - depends on I2C_ATMEL_SAM3_0 - default 2 - help - IRQ priority for Atmel SAM3 I2C Controller 0. - - Default is 2. - -config I2C_ATMEL_SAM3_0_DEFAULT_CFG - hex "Default configuration for Atmel SAM3 I2C Controller 0" - depends on I2C_ATMEL_SAM3_0 - default 0x12 - help - Allows the I2C port to be brought up with a default configuration. - This is useful to set if other drivers depend upon using the I2C bus - before the application has a chance to custom configure the port. - Setting this value does not prohibit the application from customizing - the values later. Refer to the I2C driver for proper values. - - Default is 0x12 (master mode, standard speed). - -config I2C_ATMEL_SAM3_1 - bool "Atmel SAM3 I2C Controller 1 (TWI1)" - depends on I2C_ATMEL_SAM3 - default n - help - Build driver for thw I2C Controller #1 (TWI1). - - Says y if you intend to use the TWI1. - -config I2C_ATMEL_SAM3_1_NAME - string "Device name for Atmel SAM3 I2C Controller 1" - depends on I2C_ATMEL_SAM3_1 - default "I2C_1" - help - The device name for Atmel SAM3 I2C Controller 1. - - Default is "I2C_1". - -config I2C_ATMEL_SAM3_1_IRQ_PRI - int "IRQ Priority for Atmel SAM3 I2C Controller 1" - depends on I2C_ATMEL_SAM3_1 - default 2 - help - IRQ priority for Atmel SAM3 I2C Controller 1. - - Default is 2. - -config I2C_ATMEL_SAM3_1_DEFAULT_CFG - hex "Default configuration for Atmel SAM3 I2C Controller 1" - depends on I2C_ATMEL_SAM3_1 - default 0x12 - help - Allows the I2C port to be brought up with a default configuration. - This is useful to set if other drivers depend upon using the I2C bus - before the application has a chance to custom configure the port. - Setting this value does not prohibit the application from customizing - the values later. Refer to the I2C driver for proper values. - - Default is 0x12 (master mode, standard speed). - -endif # I2C_ATMEL_SAM3 diff --git a/drivers/i2c/Kconfig.dw b/drivers/i2c/Kconfig.dw deleted file mode 100644 index 6ab891a608..0000000000 --- a/drivers/i2c/Kconfig.dw +++ /dev/null @@ -1,115 +0,0 @@ -# Kconfig.dw - DesignWare I2C configuration options -# -# -# Copyright (c) 2016 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -menuconfig I2C_DW - bool "Design Ware I2C support" - depends on I2C - default n - help - Enable Design Ware I2C support on the selected platform - -if I2C_DW - -config I2C_DW_SHARED_IRQ - bool - default n - depends on I2C_DW - -config I2C_DW_0 - bool "Enable I2C_0" - default n - depends on I2C_DW - -config I2C_DW_0_NAME - string "Select a name for finding the device" - depends on I2C_DW_0 - default "I2C_0" - -choice - prompt "I2C_0 Interrupts via" - default I2C_DW_0_IRQ_DIRECT - depends on I2C_DW_0 - -config I2C_DW_0_IRQ_DIRECT - bool "Direct Hardware Interrupt" - help - When interrupts fire, the driver's ISR function is being called directly. - -config I2C_DW_0_IRQ_SHARED - bool "Shared IRQ" - depends on SHARED_IRQ - select I2C_DW_SHARED_IRQ - help - When interrupts fire, the shared IRQ driver is notified. Then the shared IRQ - driver dispatches the interrupt to other drivers. - -endchoice - -config I2C_DW_0_IRQ_SHARED_NAME - string "Device name for Shared IRQ" - depends on I2C_DW_0 && I2C_DW_0_IRQ_SHARED - help - Specify the device name for the shared IRQ driver. It is used to register - this driver with the shared IRQ driver, so interrupts can be dispatched - correctly. - -config I2C_DW_0_IRQ_PRI - int "Controller interrupt priority" - depends on I2C_DW_0 && I2C_DW_0_IRQ_DIRECT - help - IRQ priority - -config I2C_DW_0_DEFAULT_CFG - hex "I2C default configuration" - depends on I2C_DW_0 - default 0x0 - help - Allows the I2C port to be brought up with a default configuration. - This is useful to set if other drivers depend upon using the I2C bus - before the application has a chance to custom configure the port. - Setting this value does not prohibit the application from customizing - the values later. Refer to the I2C datasheet for proper values. - -config I2C_DW_1 - bool "Enable I2C_1" - default n - depends on I2C_DW - -config I2C_DW_1_NAME - string "Select a name for finding the device" - depends on I2C_DW_1 - default "I2C_1" - -config I2C_DW_1_IRQ_PRI - int "Controller interrupt priority" - depends on I2C_DW_1 - help - IRQ priority - -config I2C_DW_1_DEFAULT_CFG - hex "I2C default configuration" - depends on I2C_DW_1 - default 0x0 - help - Allows the I2C port to be brought up with a default configuration. - This is useful to set if other drivers depend upon using the I2C bus - before the application has a chance to custom configure the port. - Setting this value does not prohibit the application from customizing - the values later. Refer to the I2C datasheet for proper values. - -endif # I2C_DW diff --git a/drivers/i2c/Kconfig.qmsi b/drivers/i2c/Kconfig.qmsi deleted file mode 100644 index 89759bfc56..0000000000 --- a/drivers/i2c/Kconfig.qmsi +++ /dev/null @@ -1,73 +0,0 @@ -# Kconfig.qmsi - QMSI I2C configuration options - -# -# Copyright (c) 2016 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -menuconfig I2C_QMSI - bool "QMSI I2C driver" - depends on I2C && QMSI - default n - help - This option enable the QMSI I2C driver. - - This driver is simply a shim driver based on the I2C driver - provided by the QMSI BSP. - -config I2C_QMSI_0 - bool "Enable I2C_0 controller" - default n - depends on I2C_QMSI - -config I2C_QMSI_0_NAME - string "I2C_0 device name" - depends on I2C_QMSI_0 - default "I2C_0" - -config I2C_QMSI_0_IRQ_PRI - int "Interrupt priority from I2C_0 controller" - depends on I2C_QMSI_0 - -config I2C_QMSI_0_DEFAULT_CFG - hex "I2C_0 default configuration" - depends on I2C_QMSI_0 - default 0x0 - help - This option specifies a default configuration for I2C_0 device - (e.g. addressing mode and bus speed) which is set during driver - initialization. Refer to I2C API for proper values. - -config I2C_QMSI_1 - bool "Enable I2C_1 controller" - default n - depends on I2C_QMSI - -config I2C_QMSI_1_NAME - string "I2C_1 device name" - depends on I2C_QMSI_1 - default "I2C_1" - -config I2C_QMSI_1_IRQ_PRI - int "Interrupt priority from I2C_1 controller" - depends on I2C_QMSI_1 - -config I2C_QMSI_1_DEFAULT_CFG - hex "I2C_1 default configuration" - depends on I2C_QMSI_1 - default 0x0 - help - This option specifies a default configuration for I2C_1 device - (e.g. addressing mode and bus speed) which is set during driver - initialization. Refer to I2C API for proper values. diff --git a/drivers/i2c/Kconfig.quark_se_ss b/drivers/i2c/Kconfig.quark_se_ss deleted file mode 100644 index 5053f17ebc..0000000000 --- a/drivers/i2c/Kconfig.quark_se_ss +++ /dev/null @@ -1,72 +0,0 @@ -# Kconfig.quark_se_ss - Quark SE Sensor Subsystem I2C configuration options -# -# -# Copyright (c) 2016 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -menuconfig I2C_QUARK_SE_SS - bool "I2C Driver for Quark SE Sensor Subsystem (SS)" - default n - depends on SOC_QUARK_SE_SS - depends on I2C - help - This option enables the driver to support the I2C on Quark SE Sensor - Subsystem. - -if I2C_QUARK_SE_SS - -config I2C_QUARK_SE_SS_0 - bool "Enable Quark SE SS I2C Port 0" - depends on I2C_QUARK_SE_SS - default n - -config I2C_QUARK_SE_SS_0_NAME - string "Select a name for finding the device" - depends on I2C_QUARK_SE_SS_0 - default "I2C_SS_0" - -config I2C_QUARK_SE_SS_0_DEFAULT_CFG - hex "Default Configuration for Quark SE SS I2C Port 0" - depends on I2C_QUARK_SE_SS_0 - default 0x0 - help - Allows the I2C port to be brought up with a default configuration. - This is useful to set if other drivers depend upon using the I2C bus - before the application has a chance to custom configure the port. - Setting this value does not prohibit the application from customizing - the values later. Refer to the I2C datasheet for proper values. - -config I2C_QUARK_SE_SS_1 - bool "Enable Quark SE SS I2C Port 1" - depends on I2C_QUARK_SE_SS - default n - -config I2C_QUARK_SE_SS_1_NAME - string "Select a name for finding the device" - depends on I2C_QUARK_SE_SS_1 - default "I2C_SS_1" - -config I2C_QUARK_SE_SS_1_DEFAULT_CFG - hex "Default Configuration for Quark SE SS I2C Port 1" - depends on I2C_QUARK_SE_SS_1 - default 0x0 - help - Allows the I2C port to be brought up with a default configuration. - This is useful to set if other drivers depend upon using the I2C bus - before the application has a chance to custom configure the port. - Setting this value does not prohibit the application from customizing - the values later. Refer to the I2C datasheet for proper values. - -endif # I2C_QUARK_SE_SS diff --git a/drivers/i2c/i2c_atmel_sam3.c b/drivers/i2c/i2c_atmel_sam3.c index a15268d8d0..8c583316b7 100644 --- a/drivers/i2c/i2c_atmel_sam3.c +++ b/drivers/i2c/i2c_atmel_sam3.c @@ -632,7 +632,7 @@ static int i2c_sam3_init(struct device *dev) return 0; } -#ifdef CONFIG_I2C_ATMEL_SAM3_0 +#ifdef CONFIG_I2C_0 static void config_func_0(struct device *port); @@ -642,10 +642,10 @@ static struct i2c_sam3_dev_config dev_config_0 = { }; static struct i2c_sam3_dev_data dev_data_0 = { - .dev_config.raw = CONFIG_I2C_ATMEL_SAM3_0_DEFAULT_CFG, + .dev_config.raw = CONFIG_I2C_0_DEFAULT_CFG, }; -DEVICE_AND_API_INIT(i2c_sam3_0, CONFIG_I2C_ATMEL_SAM3_0_NAME, &i2c_sam3_init, +DEVICE_AND_API_INIT(i2c_sam3_0, CONFIG_I2C_0_NAME, &i2c_sam3_init, &dev_data_0, &dev_config_0, SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &api_funcs); @@ -655,14 +655,14 @@ static void config_func_0(struct device *dev) /* Enable clock for TWI0 controller */ __PMC->pcer0 = (1 << PID_TWI0); - IRQ_CONNECT(IRQ_TWI0, CONFIG_I2C_ATMEL_SAM3_0_IRQ_PRI, + IRQ_CONNECT(IRQ_TWI0, CONFIG_I2C_0_IRQ_PRI, i2c_sam3_isr, DEVICE_GET(i2c_sam3_0), 0); irq_enable(IRQ_TWI0); } -#endif /* CONFIG_I2C_ATMEL_SAM3_0 */ +#endif /* CONFIG_I2C_0 */ -#ifdef CONFIG_I2C_ATMEL_SAM3_1 +#ifdef CONFIG_I2C_1 static void config_func_1(struct device *port); @@ -672,10 +672,10 @@ static struct i2c_sam3_dev_config dev_config_1 = { }; static struct i2c_sam3_dev_data dev_data_1 = { - .dev_config.raw = CONFIG_I2C_ATMEL_SAM3_1_DEFAULT_CFG, + .dev_config.raw = CONFIG_I2C_1_DEFAULT_CFG, }; -DEVICE_AND_API_INIT(i2c_sam3_1, CONFIG_I2C_ATMEL_SAM3_1_NAME, &i2c_sam3_init, +DEVICE_AND_API_INIT(i2c_sam3_1, CONFIG_I2C_1_NAME, &i2c_sam3_init, &dev_data_1, &dev_config_1, SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &api_funcs); @@ -685,9 +685,9 @@ static void config_func_1(struct device *dev) /* Enable clock for TWI0 controller */ __PMC->pcer0 = (1 << PID_TWI1); - IRQ_CONNECT(IRQ_TWI1, CONFIG_I2C_ATMEL_SAM3_1_IRQ_PRI, + IRQ_CONNECT(IRQ_TWI1, CONFIG_I2C_1_IRQ_PRI, i2c_sam3_isr, DEVICE_GET(i2c_sam3_1), 0); irq_enable(IRQ_TWI1); } -#endif /* CONFIG_I2C_ATMEL_SAM3_1 */ +#endif /* CONFIG_I2C_1 */ diff --git a/drivers/i2c/i2c_dw.c b/drivers/i2c/i2c_dw.c index 22d1624047..f0db82933e 100644 --- a/drivers/i2c/i2c_dw.c +++ b/drivers/i2c/i2c_dw.c @@ -746,18 +746,18 @@ int i2c_dw_initialize(struct device *port) } /* system bindings */ -#if CONFIG_I2C_DW_0 +#if CONFIG_I2C_0 void i2c_config_0(struct device *port); struct i2c_dw_rom_config i2c_config_dw_0 = { .base_address = I2C_DW_0_BASE_ADDR, -#ifdef CONFIG_I2C_DW_0_IRQ_DIRECT +#ifdef CONFIG_I2C_0_IRQ_DIRECT .irq_num = I2C_DW_0_IRQ, #endif .config_func = i2c_config_0, #ifdef CONFIG_GPIO_DW_0_IRQ_SHARED - .shared_irq_dev_name = CONFIG_I2C_DW_0_IRQ_SHARED_NAME, + .shared_irq_dev_name = CONFIG_I2C_0_IRQ_SHARED_NAME, #endif #if CONFIG_PCI @@ -772,10 +772,10 @@ struct i2c_dw_rom_config i2c_config_dw_0 = { }; struct i2c_dw_dev_config i2c_0_runtime = { - .app_config.raw = CONFIG_I2C_DW_0_DEFAULT_CFG, + .app_config.raw = CONFIG_I2C_0_DEFAULT_CFG, }; -DEVICE_AND_API_INIT(i2c_0, CONFIG_I2C_DW_0_NAME, &i2c_dw_initialize, +DEVICE_AND_API_INIT(i2c_0, CONFIG_I2C_0_NAME, &i2c_dw_initialize, &i2c_0_runtime, &i2c_config_dw_0, SECONDARY, CONFIG_I2C_INIT_PRIORITY, &funcs); @@ -785,25 +785,25 @@ void i2c_config_0(struct device *port) struct i2c_dw_rom_config * const config = port->config->config_info; struct device *shared_irq_dev; -#if defined(CONFIG_I2C_DW_0_IRQ_DIRECT) +#if defined(CONFIG_I2C_0_IRQ_DIRECT) ARG_UNUSED(shared_irq_dev); - IRQ_CONNECT(I2C_DW_0_IRQ, CONFIG_I2C_DW_0_IRQ_PRI, + IRQ_CONNECT(I2C_DW_0_IRQ, CONFIG_I2C_0_IRQ_PRI, i2c_dw_isr, DEVICE_GET(i2c_0), I2C_DW_IRQ_FLAGS); irq_enable(config->irq_num); -#elif defined(CONFIG_I2C_DW_0_IRQ_SHARED) +#elif defined(CONFIG_I2C_0_IRQ_SHARED) ARG_UNUSED(config); shared_irq_dev = device_get_binding(config->shared_irq_dev_name); shared_irq_isr_register(shared_irq_dev, (isr_t)i2c_dw_isr, port); shared_irq_enable(shared_irq_dev, port); #endif } -#endif /* CONFIG_I2C_DW_0 */ +#endif /* CONFIG_I2C_0 */ /* * Adding in I2C1 */ -#if CONFIG_I2C_DW_1 +#if CONFIG_I2C_1 void i2c_config_1(struct device *port); struct i2c_dw_rom_config i2c_config_dw_1 = { @@ -823,10 +823,10 @@ struct i2c_dw_rom_config i2c_config_dw_1 = { }; struct i2c_dw_dev_config i2c_1_runtime = { - .app_config.raw = CONFIG_I2C_DW_1_DEFAULT_CFG, + .app_config.raw = CONFIG_I2C_1_DEFAULT_CFG, }; -DEVICE_AND_API_INIT(i2c_1, CONFIG_I2C_DW_1_NAME, &i2c_dw_initialize, +DEVICE_AND_API_INIT(i2c_1, CONFIG_I2C_1_NAME, &i2c_dw_initialize, &i2c_1_runtime, &i2c_config_dw_1, SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &funcs); @@ -835,9 +835,9 @@ void i2c_config_1(struct device *port) { struct i2c_dw_rom_config * const config = port->config->config_info; - IRQ_CONNECT(I2C_DW_1_IRQ, CONFIG_I2C_DW_1_IRQ_PRI, + IRQ_CONNECT(I2C_DW_1_IRQ, CONFIG_I2C_1_IRQ_PRI, i2c_dw_isr, DEVICE_GET(i2c_1), I2C_DW_IRQ_FLAGS); irq_enable(config->irq_num); } -#endif /* CONFIG_I2C_DW_1 */ +#endif /* CONFIG_I2C_1 */ diff --git a/drivers/i2c/i2c_dw.h b/drivers/i2c/i2c_dw.h index b2a84fd67f..f1cf30ce76 100644 --- a/drivers/i2c/i2c_dw.h +++ b/drivers/i2c/i2c_dw.h @@ -103,9 +103,9 @@ struct i2c_dw_rom_config { #endif /* CONFIG_PCI */ i2c_isr_cb_t config_func; -#ifdef CONFIG_I2C_DW_SHARED_IRQ +#ifdef CONFIG_I2C_SHARED_IRQ char *shared_irq_dev_name; -#endif /* CONFIG_I2C_DW_SHARED_IRQ */ +#endif /* CONFIG_I2C_SHARED_IRQ */ }; diff --git a/drivers/i2c/i2c_qmsi.c b/drivers/i2c/i2c_qmsi.c index 62a3a25f30..988c106d7c 100644 --- a/drivers/i2c/i2c_qmsi.c +++ b/drivers/i2c/i2c_qmsi.c @@ -41,33 +41,33 @@ struct i2c_qmsi_driver_data { static int i2c_qmsi_init(struct device *dev); -#ifdef CONFIG_I2C_QMSI_0 +#ifdef CONFIG_I2C_0 static struct i2c_qmsi_driver_data driver_data_0; static struct i2c_qmsi_config_info config_info_0 = { .instance = QM_I2C_0, - .default_cfg.raw = CONFIG_I2C_QMSI_0_DEFAULT_CFG, + .default_cfg.raw = CONFIG_I2C_0_DEFAULT_CFG, }; -DEVICE_INIT(i2c_0, CONFIG_I2C_QMSI_0_NAME, i2c_qmsi_init, &driver_data_0, +DEVICE_INIT(i2c_0, CONFIG_I2C_0_NAME, i2c_qmsi_init, &driver_data_0, &config_info_0, SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); -#endif /* CONFIG_I2C_QMSI_0 */ +#endif /* CONFIG_I2C_0 */ -#ifdef CONFIG_I2C_QMSI_1 +#ifdef CONFIG_I2C_1 static struct i2c_qmsi_driver_data driver_data_1; static struct i2c_qmsi_config_info config_info_1 = { .instance = QM_I2C_1, - .default_cfg.raw = CONFIG_I2C_QMSI_1_DEFAULT_CFG, + .default_cfg.raw = CONFIG_I2C_1_DEFAULT_CFG, }; -DEVICE_INIT(i2c_1, CONFIG_I2C_QMSI_1_NAME, i2c_qmsi_init, &driver_data_1, +DEVICE_INIT(i2c_1, CONFIG_I2C_1_NAME, i2c_qmsi_init, &driver_data_1, &config_info_1, SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); -#endif /* CONFIG_I2C_QMSI_1 */ +#endif /* CONFIG_I2C_1 */ static int i2c_qmsi_configure(struct device *dev, uint32_t config) { @@ -111,12 +111,12 @@ static void transfer_complete(uint32_t id, qm_rc_t status) struct i2c_qmsi_driver_data *driver_data; switch (id) { -#ifdef CONFIG_I2C_QMSI_0 +#ifdef CONFIG_I2C_0 case QM_I2C_0: dev = DEVICE_GET(i2c_0); break; #endif -#ifdef CONFIG_I2C_QMSI_1 +#ifdef CONFIG_I2C_1 case QM_I2C_1: dev = DEVICE_GET(i2c_1); break; @@ -218,7 +218,7 @@ static int i2c_qmsi_init(struct device *dev) * to Lakemont core. */ IRQ_CONNECT(QM_IRQ_I2C_0, - CONFIG_I2C_QMSI_0_IRQ_PRI, qm_i2c_0_isr, NULL, + CONFIG_I2C_0_IRQ_PRI, qm_i2c_0_isr, NULL, (IOAPIC_LEVEL | IOAPIC_HIGH)); irq_enable(QM_IRQ_I2C_0); QM_SCSS_INT->int_i2c_mst_0_mask &= ~BIT(0); @@ -226,17 +226,17 @@ static int i2c_qmsi_init(struct device *dev) clk_periph_enable(CLK_PERIPH_I2C_M0_REGISTER | CLK_PERIPH_CLK); break; -#ifdef CONFIG_I2C_QMSI_1 +#ifdef CONFIG_I2C_1 case QM_I2C_1: IRQ_CONNECT(QM_IRQ_I2C_1, - CONFIG_I2C_QMSI_1_IRQ_PRI, qm_i2c_1_isr, NULL, + CONFIG_I2C_1_IRQ_PRI, qm_i2c_1_isr, NULL, (IOAPIC_LEVEL | IOAPIC_HIGH)); irq_enable(QM_IRQ_I2C_1); QM_SCSS_INT->int_i2c_mst_1_mask &= ~BIT(0); clk_periph_enable(CLK_PERIPH_I2C_M1_REGISTER | CLK_PERIPH_CLK); break; -#endif /* CONFIG_I2C_QMSI_1 */ +#endif /* CONFIG_I2C_1 */ default: return -EIO; diff --git a/drivers/i2c/i2c_quark_se_ss.c b/drivers/i2c/i2c_quark_se_ss.c index 8321e70dc2..e21fcf789d 100644 --- a/drivers/i2c/i2c_quark_se_ss.c +++ b/drivers/i2c/i2c_quark_se_ss.c @@ -641,7 +641,7 @@ int i2c_qse_ss_initialize(struct device *dev) return 0; } -#if CONFIG_I2C_QUARK_SE_SS_0 +#if CONFIG_I2C_0 #include static void _i2c_qse_ss_config_irq_0(struct device *port); @@ -653,10 +653,10 @@ static const struct i2c_qse_ss_rom_config i2c_config_ss_0 = { }; static struct i2c_qse_ss_dev_config i2c_ss_0_runtime = { - .app_config.raw = CONFIG_I2C_QUARK_SE_SS_0_DEFAULT_CFG, + .app_config.raw = CONFIG_I2C_0_DEFAULT_CFG, }; -DEVICE_AND_API_INIT(i2c_ss_0, CONFIG_I2C_QUARK_SE_SS_0_NAME, +DEVICE_AND_API_INIT(i2c_ss_0, CONFIG_I2C_0_NAME, &i2c_qse_ss_initialize, &i2c_ss_0_runtime, (void *)&i2c_config_ss_0, SECONDARY, CONFIG_I2C_INIT_PRIORITY, @@ -702,9 +702,9 @@ static void _i2c_qse_ss_config_irq_0(struct device *port) irq_enable(I2C_SS_0_STOP_VECTOR); } -#endif /* CONFIG_I2C_QUARK_SE_SS_0 */ +#endif /* CONFIG_I2C_0 */ -#if CONFIG_I2C_QUARK_SE_SS_1 +#if CONFIG_I2C_1 #include static void _i2c_qse_ss_config_irq_1(struct device *port); @@ -716,10 +716,10 @@ static const struct i2c_qse_ss_rom_config i2c_config_ss_1 = { }; static struct i2c_qse_ss_dev_config i2c_qse_ss_1_runtime = { - .app_config.raw = CONFIG_I2C_QUARK_SE_SS_1_DEFAULT_CFG, + .app_config.raw = CONFIG_I2C_1_DEFAULT_CFG, }; -DEVICE_AND_API_INIT(i2c_ss_1, CONFIG_I2C_QUARK_SE_SS_1_NAME, +DEVICE_AND_API_INIT(i2c_ss_1, CONFIG_I2C_1_NAME, &i2c_qse_ss_initialize, &i2c_qse_ss_1_runtime, (void *)&i2c_config_ss_1, SECONDARY, CONFIG_I2C_INIT_PRIORITY); @@ -766,4 +766,4 @@ static void _i2c_qse_ss_config_irq_1(struct device *port) irq_enable(I2C_SS_1_STOP_VECTOR); } -#endif /* CONFIG_I2C_QUARK_SE_SS_1 */ +#endif /* CONFIG_I2C_1 */ diff --git a/samples/drivers/current_sensing/prj.conf b/samples/drivers/current_sensing/prj.conf index f9659582c9..9332f6ef86 100644 --- a/samples/drivers/current_sensing/prj.conf +++ b/samples/drivers/current_sensing/prj.conf @@ -1,4 +1,3 @@ CONFIG_STDOUT_CONSOLE=y CONFIG_PRINTK=y - CONFIG_I2C=y diff --git a/samples/drivers/sensor_apds9960/prj_arc.conf b/samples/drivers/sensor_apds9960/prj_arc.conf index 3b74536449..c114e2908a 100644 --- a/samples/drivers/sensor_apds9960/prj_arc.conf +++ b/samples/drivers/sensor_apds9960/prj_arc.conf @@ -2,4 +2,4 @@ CONFIG_STDOUT_CONSOLE=y CONFIG_PRINTK=y CONFIG_GPIO=y CONFIG_I2C=y -CONFIG_I2C_QUARK_SE_SS_0_DEFAULT_CFG=0x14 +CONFIG_I2C_0_DEFAULT_CFG=0x14 diff --git a/samples/sensor/bmg160/prj.conf b/samples/sensor/bmg160/prj.conf index 5f18b84e0f..fc3e1dd205 100644 --- a/samples/sensor/bmg160/prj.conf +++ b/samples/sensor/bmg160/prj.conf @@ -4,8 +4,6 @@ CONFIG_PRINTK=y CONFIG_GPIO=y CONFIG_I2C=y -CONFIG_I2C_QUARK_SE_SS=y -CONFIG_I2C_QUARK_SE_SS_0=y CONFIG_SYS_LOG=y diff --git a/samples/sensor/bmp280/prj.conf b/samples/sensor/bmp280/prj.conf index 192c44a05c..c19c68b461 100644 --- a/samples/sensor/bmp280/prj.conf +++ b/samples/sensor/bmp280/prj.conf @@ -1,9 +1,6 @@ CONFIG_STDOUT_CONSOLE=y CONFIG_I2C=y -CONFIG_I2C_QUARK_SE_SS=y -CONFIG_I2C_QUARK_SE_SS_0=y - CONFIG_NANO_TIMEOUTS=y CONFIG_SENSOR=y diff --git a/samples/sensor/mcp9808/prj.conf b/samples/sensor/mcp9808/prj.conf index a352a2c121..9daeae7606 100644 --- a/samples/sensor/mcp9808/prj.conf +++ b/samples/sensor/mcp9808/prj.conf @@ -1,9 +1,6 @@ CONFIG_STDOUT_CONSOLE=y CONFIG_I2C=y -CONFIG_I2C_QUARK_SE_SS=y -CONFIG_I2C_QUARK_SE_SS_0=y - CONFIG_GPIO=y CONFIG_NANO_TIMEOUTS=y