MTK平台釋疑android M 配置中斷相關問題

來源:互聯網
上載者:User

標籤:

1.使用老方法(android L)配置中斷,調用request_irq函數時出錯,錯誤碼 -22  Dear Customer:
您好!
如電話溝通,貴司可以在發過來的code基礎上做下面的修改再試試:
(1)修改aw8155.c

static int aw8155_drv_probe(struct platform_device *dev)
{
//...

// ------------------ here add your code to init device tree
-------------------- start
aw8155_pinctrl1 =
devm_pinctrl_get(&dev->dev);
if (IS_ERR(aw8155_pinctrl1)) {

AW8155_LOGE("devm_pinctrl_get error\n");
}
else{ //add

pins_default = pinctrl_lookup_state(aw8155_pinctrl1, "default");
if
(IS_ERR(pins_default)) {
AW8155_LOGE("pinctrl_lookup_state default
error\n");
}

pa_pins_int = pinctrl_lookup_state(aw8155_pinctrl1,
"pa_ctl_output0");
if (IS_ERR(pa_pins_int)) {

AW8155_LOGE("pinctrl_lookup_state pa_ctl_output0 error\n");
}
else
//add
pinctrl_select_state(aw8155_pinctrl1, pa_pins_int);
}
// ------------------ here add your code to init device tree ---------------------- end
//...

#if 0 //add
static struct platform_device
aw8155_platform_device = {
.name = "aw8155",
.id = -1,
.dev = {

.release = aw8155_dev_release,
}
};
#endif
static int __init
aw8155_init(void)
{
int ret = 0;
AW8155_LOGD("+%s\n", __func__);

#if 0 //add
ret = platform_device_register
(&aw8155_platform_device);
if (ret) {

AW8155_LOGE("platform_device_register fail\n");
return ret;
}

#endif

(2)修改fc8180_spi.c
static int dtveint_drv_probe(struct
platform_device *dev)
{
//...
eint_pinctrl =
devm_pinctrl_get(&dev->dev);
if (IS_ERR(eint_pinctrl)) {

printk(KERN_INFO "eintDebug devm_pinctrl_get error\n");
}
else{
//add
pins_default = pinctrl_lookup_state(eint_pinctrl, "default");
if
(IS_ERR(pins_default)) {
printk(KERN_INFO "eintDebug pinctrl_lookup_state
default error\n");
}

eint_pins = pinctrl_lookup_state(eint_pinctrl,
"eint_cfg");
if (IS_ERR(eint_pins)) {
printk(KERN_INFO "eintDebug
pinctrl_lookup_state pa_ctl_output0 error\n");
}
else //add

pinctrl_select_state(eint_pinctrl, eint_pins);
}
//...

#if 0
//add
static struct platform_device dtveint_platform_device = {
.name =
"dtveint",
.id = -1,
.dev = {
.release = dtveint_dev_release,
}

};
#endif
static int dtveint_init(void)
{
int ret = 0;

printk(KERN_INFO "eintDebug +%s\n", __func__);
#if 0 //add
ret =
platform_device_register (&dtveint_platform_device);
if (ret) {

printk("eintDebug platform_device_register fail\n");
return ret;
}

#endif
//...
謝謝!

2.使用spi_device驅動調用devm_pinctrl_get(&spi->dev),出現錯誤,反覆重啟,錯誤
”log見反覆重啟.log“ Dear Customer:
您好!
您這個cust_eint.dtsi檔案是通過window下運行dct
tool產生的吧,這個只是做個參考。我們真正使用的是編譯產生的cust.dtsi。所以您要check的話,可以check檔案cust.dtsi。或者在linux下運行
dct產生相應的檔案。

example:
(1)在window下運行dct
tool產生的cust_eint.dtsi檔案中的accdet中斷為:
[email protected] {
compatible = "mediatek,
ACCDET-eint";
interrupt-parent = <&eintc>;
interrupts = <6
8>;
debounce = <6 256000>;
};
(2)在linux下運行dct
產生的cust_eint_dtsi檔案會在編譯產生cust.dtsi檔案中的accdet中斷為:
&accdet {

interrupt-parent = <&eintc>;
interrupts = <6
IRQ_TYPE_LEVEL_LOW>;
debounce = <6 256000>;
status = "okay";

};

謝謝!  3.能否提供一個spi驅動裝置樹配置的樣板,可能過後需要在spi驅動的probe中進行中斷和gpio的配置? Dear Customer:
您好!
舉例,在SPI0 bus上掛device
(kernel-3.18\arch\arm64\boot\dts\xxxx.dts)

&spi0 {

#address-cells = <1>;
#size-cells = <0>;

label:Your
device [email protected] {
compatible = "your compatible name";
reg = <0>;
=> 表示SPI0上的第一個device
spi-max-frequency = <xxxx>; =>
如有需要,可自行添加SPI相關的info,這裡以max freq為例
/* your device info ….*/
};
};


   

MTK平台釋疑android M 配置中斷相關問題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.