Sources
Fungus, from USDA nutrient database (per 100g), D2 + D3:
Mushrooms, Agaricus bisporus:
raw portobello: 0.3 μg (10 IU); exposed to ultraviolet light: 11.2 µg (446 IU)
raw crimini: 0.1 μg (3 IU); exposed to ultraviolet light: 31.9 µg (1276 IU)
Mushrooms, shiitake:
raw: Vitamin D (D2 + D3): 0.4 μg (18 IU)
dried: Vitamin D (D2 + D3): 3.9 μg (154 IU)Lichen

Cladina arbuscula specimens grown under different natural conditions contain provitamin D2 and vitamin D2, ranges 89-146 and 0.22-0.55 μg/g dry matter respectively. They also contain vitamin D3 (range 0.67 to 2.04 μg/g) although provitamin D3 could not be detected. Vitamin D levels correlate positively with UV irradiation.Plantae

Alfalfa (Medicago sativa subsp. sativa), shoot: 4.8 μg (192 IU) vitamin D2, 0.1 μg (4 IU) vitamin D3

Biosynthesis
The vitamin D2 content in mushrooms and C. arbuscula increase with exposure to ultraviolet light. Ergosterol (provitamin D2) found in these fungi is converted to previtamin D2 on UV exposure, which then turns into vitamin D2. As cultured mushrooms are generally grown in darkness, less vitamin D2 is found compared to those grown in the wild or dried in the sun.When fresh mushrooms or dried powders are purposely exposed to ultraviolet light, vitamin D2 levels can be concentrated to much higher levels. The irradiation procedure does not cause significant discoloration, or whitening, of mushrooms. Claims have been made that a normal serving (approx.
Ergocalciferol (D2) and cholecalciferol (D3) are considered to be equivalent for vitamin D production, as both forms appear to have similar efficacy in ameliorating rickets and reducing the incidence of falls in elderly patients. Conflicting reports exist, however, concerning the relative effectiveness, with some studies suggesting that ergocalciferol has less efficacy based on limitations in absorption, binding, and inactivation. A meta-analysis concluded that evidence usually favors cholecalciferol in raising vitamin D levels in blood, although it stated more research is needed. Mechanism
Ergocalciferol is a secosteroid formed by a photochemical bond breaking of a steroid, specifically, by the action of ultraviolet light (UV-B or UV-C) on ergosterol, a form of provitamin D2.Like cholecalciferol, ergocalciferol is inactive by itself. It requires two hydroxylations to become active: the first in the liver by CYP2R1 to form 25-hydroxyergocalciferol (ercalcidiol or 25-OH D2), and the second in the kidney by CYP27B1, to form the active 1,25-dihydroxyergocalciferol (ercalcitriol or 1,25-(OH)2D2), which activates the vitamin D receptor. Unlike cholecalciferol, 25-hydroxylation is not performed by CYP27A1 for ergocalciferol.Ergocalciferol and metabolites have lower affinity to the vitamin D-binding protein compared to the D3 counterparts. The binding affinity of ercalcitriol to the vitamin D receptor is similar to that of calcitriol. Ergocalciferol itself and metabolites can be deactivated by 24-hydroxylation.