Only cash contributions (e.g., checks, credit card charges) are acceptable in 529 plans. You’ll have to sell the stock and donate the proceeds. If the stock has appreciated, you’ll owe capital gains tax on your profits; if the value has declined, you’ll be able to take a tax loss.
Casualty losses such as from a storm, in areas declared by the President to warrant federal assistance. An election may be made to deduct the loss in the year before the loss or the year of the loss.