I am bewildered by the number of things I've heard referred to as "Koszul duality", and I would like to sort it out. At various different times, I believe I've seen any of the following phenomena referred to as "Koszul duality":
Let $O$ be an operad (in your favorite symmetric monoidal $\infty$-category $\mathcal V$), and apply the operadic bar construction to $O$ (i.e. regard $O$ as a monoid in symmetric sequences equipped with Kelly's convolution monoidal product $\circ$, and take the the geometric realization of the simplicial symmetric sequence $[n] \mapsto O^{\circ n}$) to obtain $BO$. Then (under certain conditions?) $BO$ is a cooperad, called the Koszul dual of $O$. Dually, if $C$ is a cooperad, then applying the operadic cobar construction to $C$ yields an operad called the Koszul dual of $C$. Under certain conditions, these constructions are adjoint to one another, and under certain further conditions they are inverse to one another.
There is a version of (1) called Koszul duality carrying $O$-modules to $BO$-comodules (and maybe a variant carrying $O$-algebras to $BO$-coalgebras?).
Let $O$ be the $E_k$ operad, and let $A$ be an $O$-algebra. Then there is an iterated bar-construction carrying $A$ to an $E_k$-coalgebra, which is called its Koszul dual.
Let $O$ be a quadratic operad in the sense of Ginzburg and Kapranov (quadratic-ness only makes sense in certain $\mathcal V$ -- basically $V$ must be chain complexes). Then there is another quadratic operad Koszul dual to $O$, and if $O$ is Koszul, then the duality operation is self-inverse at $O$.
There is also Koszul duality for algebras for the associative operad.
I think I've been told that the $E_k$-operad is Koszul self-dual. Since the $E_k$-operad makes sense in spaces, where quadraticness isn't even defined, I don't know what this means (I only know what it means for an operad to be dual to a coopeard in this generality, following (1)).
I think what's going on is that the fundamental duality is the bar/cobar adjunction between operads $O$ and cooperads $BO$; duality between $O$-modules and $BO$-comodules, and between $O$-algebras and $BO$-coalgebras then comes along for the ride. Then some other form of duality sometimes allows one to relate cooperads back to operads, and we start talking about duality between operads, and between the modules / algebras for an operad and its dual operad from there. But I've never really seen this spelled out in this general a context.
Question: What is the relationship between the above things called Koszul duality (and other things called Koszul duality which I'm missing)?
I hope it's clear that this question has a different focus from this classic MO question.