Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
linux-elphel
Commits
bb96d648
Commit
bb96d648
authored
Nov 09, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Plain Diff
merged with master
parents
140d0e5b
0d8ea7fc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
6 deletions
+51
-6
circbuf.c
src/drivers/elphel/circbuf.c
+2
-1
sdhci.c
src/drivers/mmc/host/sdhci.c
+47
-5
sdhci.h
src/drivers/mmc/host/sdhci.h
+2
-0
No files found.
src/drivers/elphel/circbuf.c
View file @
bb96d648
...
...
@@ -617,7 +617,8 @@ loff_t circbuf_lseek(struct file * file, loff_t offset, int orig) {
case
LSEEK_CIRC_USED
:
bp
=
((
camSeqGetJPEG_wp
(
chn
)
<<
2
)
-
file
->
f_pos
);
// return (bp>=0)?bp:(bp+l); //!will return 0 if current pointer is a write pointer (waiting for the next frame)
return
(
file
->
f_pos
=
(
bp
>
0
)
?
bp
:
(
bp
+
circbuf_priv_ptr
[
chn
].
buf_size
));
//!Has a side effect of moving a file pointer!
// the condition below was (bp>0), but this resulted in the same _FREE and _USED sizes reported when file and HW pointers are equal
return
(
file
->
f_pos
=
(
bp
>=
0
)
?
bp
:
(
bp
+
circbuf_priv_ptr
[
chn
].
buf_size
));
//!Has a side effect of moving a file pointer!
case
LSEEK_CIRC_TORP
:
break
;
case
LSEEK_CIRC_TOWP
:
...
...
src/drivers/mmc/host/sdhci.c
View file @
bb96d648
...
...
@@ -151,7 +151,16 @@ static void sdhci_set_card_detection(struct sdhci_host *host, bool enable)
if
(
enable
)
{
present
=
sdhci_readl
(
host
,
SDHCI_PRESENT_STATE
)
&
SDHCI_DAT3_PRESENT
;
SDHCI_ANY_PRESENT
;
/* oleg's debug
if (!present){
pr_err("Forcing Card Present\n");
present = SDHCI_ANY_PRESENT;
}else{
pr_err("Card Is Present\n");
}
*/
host
->
ier
|=
present
?
SDHCI_INT_CARD_REMOVE
:
SDHCI_INT_CARD_INSERT
;
...
...
@@ -207,9 +216,13 @@ static void sdhci_do_reset(struct sdhci_host *host, u8 mask)
{
if
(
host
->
quirks
&
SDHCI_QUIRK_NO_CARD_NO_RESET
)
{
if
(
!
(
sdhci_readl
(
host
,
SDHCI_PRESENT_STATE
)
&
SDHCI_DAT3_PRESENT
))
SDHCI_ANY_PRESENT
)){
// oleg's debug
//pr_err("!!!!!sdhci_doNOT_reset!!!!");
return
;
}
}
//pr_err("!!!!!sdhci_do_reset!!!!");
host
->
ops
->
reset
(
host
,
mask
);
...
...
@@ -1395,10 +1408,19 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
present
=
1
;
else
present
=
sdhci_readl
(
host
,
SDHCI_PRESENT_STATE
)
&
SDHCI_DAT3
_PRESENT
;
SDHCI_ANY
_PRESENT
;
}
/*oleg's debug
if (!present){
pr_err("sdhci card request: card not present?\n");
present = 1;
}else{
pr_err("sdhci card request: CARD IS PRESENT: 0x%08x\n",present);
}
*/
if
(
!
present
||
host
->
flags
&
SDHCI_DEVICE_DEAD
)
{
host
->
mrq
->
cmd
->
error
=
-
ENOMEDIUM
;
tasklet_schedule
(
&
host
->
finish_tasklet
);
}
else
{
...
...
@@ -1651,6 +1673,7 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
static
int
sdhci_do_get_cd
(
struct
sdhci_host
*
host
)
{
int
gpio_cd
=
mmc_gpio_get_cd
(
host
->
mmc
);
int
present
;
if
(
host
->
flags
&
SDHCI_DEVICE_DEAD
)
return
0
;
...
...
@@ -1664,8 +1687,18 @@ static int sdhci_do_get_cd(struct sdhci_host *host)
if
(
!
IS_ERR_VALUE
(
gpio_cd
))
return
!!
gpio_cd
;
present
=
!!
(
sdhci_readl
(
host
,
SDHCI_PRESENT_STATE
)
&
SDHCI_ANY_PRESENT
);
/* oleg's debug
if (!present){
pr_err("sdhci_do_get_cd: card not present\n");
present = 1;
}else{
pr_err("sdhci_do_get_cd: CARD IS PRESENT\n");
}
*/
/* Host native card detect */
return
!!
(
sdhci_readl
(
host
,
SDHCI_PRESENT_STATE
)
&
SDHCI_DAT3_PRESENT
)
;
return
present
;
}
static
int
sdhci_get_cd
(
struct
mmc_host
*
mmc
)
...
...
@@ -2606,7 +2639,16 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id)
if
(
intmask
&
(
SDHCI_INT_CARD_INSERT
|
SDHCI_INT_CARD_REMOVE
))
{
u32
present
=
sdhci_readl
(
host
,
SDHCI_PRESENT_STATE
)
&
SDHCI_DAT3_PRESENT
;
SDHCI_ANY_PRESENT
;
/*
if (!present){
pr_err("sdhci_irq: card not present\n");
present = 1;
}else{
pr_err("sdhci_irq: card is present\n");
}
*/
/*
* There is a observation on i.mx esdhc. INSERT
...
...
src/drivers/mmc/host/sdhci.h
View file @
bb96d648
...
...
@@ -70,6 +70,8 @@
#define SDHCI_DATA_AVAILABLE 0x00000800
#define SDHCI_CARD_PRESENT 0x00010000
#define SDHCI_DAT3_PRESENT 0x00800000
//For 10393 rev.B unreliable D3 detection
#define SDHCI_ANY_PRESENT (SDHCI_CARD_PRESENT | SDHCI_DAT3_PRESENT)
#define SDHCI_WRITE_PROTECT 0x00080000
#define SDHCI_DATA_LVL_MASK 0x00F00000
#define SDHCI_DATA_LVL_SHIFT 20
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment